Stream: git-wasmtime

Topic: wasmtime / PR #2437 Introduce benchmarking API


view this post on Zulip Wasmtime GitHub notifications bot (Nov 20 2020 at 19:47):

abrown requested alexcrichton, fitzgen, cfallin and jlb6740 for a review on PR #2437.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 20 2020 at 19:47):

abrown opened PR #2437 from bench-api to main:

The new crate introduced here, wasmtime-bench-api, creates a shared library, e.g. wasmtime_bench_api.so, for executing Wasm benchmarks using Wasmtime. It allows us to measure several phases separately by exposing engine_compile_module, engine_instantiate_module, and engine_execute_module, which pass around an opaque pointer to the internally initialized state. This state is initialized and freed by engine_create and engine_free, respectively. The API also introduces a way of passing in functions to satisfy the "bench" "start" and "bench" "end" symbols that we expect Wasm benchmarks to import. The API is exposed in a C-compatible way so that we can dynamically load it (carefully) in our benchmark runner.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Nov 20 2020 at 19:47):

abrown requested alexcrichton, fitzgen, cfallin and jlb6740 for a review on PR #2437.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 20 2020 at 19:47):

abrown requested alexcrichton, fitzgen, cfallin and jlb6740 for a review on PR #2437.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 20 2020 at 19:47):

abrown requested alexcrichton, fitzgen, cfallin and jlb6740 for a review on PR #2437.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 20 2020 at 19:47):

abrown updated PR #2437 from bench-api to main:

The new crate introduced here, wasmtime-bench-api, creates a shared library, e.g. wasmtime_bench_api.so, for executing Wasm benchmarks using Wasmtime. It allows us to measure several phases separately by exposing engine_compile_module, engine_instantiate_module, and engine_execute_module, which pass around an opaque pointer to the internally initialized state. This state is initialized and freed by engine_create and engine_free, respectively. The API also introduces a way of passing in functions to satisfy the "bench" "start" and "bench" "end" symbols that we expect Wasm benchmarks to import. The API is exposed in a C-compatible way so that we can dynamically load it (carefully) in our benchmark runner.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Nov 20 2020 at 19:49):

bjorn3 submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 20 2020 at 19:49):

bjorn3 created PR Review Comment:

nit: missing trailing newline

view this post on Zulip Wasmtime GitHub notifications bot (Nov 20 2020 at 19:55):

abrown updated PR #2437 from bench-api to main:

The new crate introduced here, wasmtime-bench-api, creates a shared library, e.g. wasmtime_bench_api.so, for executing Wasm benchmarks using Wasmtime. It allows us to measure several phases separately by exposing engine_compile_module, engine_instantiate_module, and engine_execute_module, which pass around an opaque pointer to the internally initialized state. This state is initialized and freed by engine_create and engine_free, respectively. The API also introduces a way of passing in functions to satisfy the "bench" "start" and "bench" "end" symbols that we expect Wasm benchmarks to import. The API is exposed in a C-compatible way so that we can dynamically load it (carefully) in our benchmark runner.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Nov 20 2020 at 19:56):

abrown updated PR #2437 from bench-api to main:

The new crate introduced here, wasmtime-bench-api, creates a shared library, e.g. wasmtime_bench_api.so, for executing Wasm benchmarks using Wasmtime. It allows us to measure several phases separately by exposing engine_compile_module, engine_instantiate_module, and engine_execute_module, which pass around an opaque pointer to the internally initialized state. This state is initialized and freed by engine_create and engine_free, respectively. The API also introduces a way of passing in functions to satisfy the "bench" "start" and "bench" "end" symbols that we expect Wasm benchmarks to import. The API is exposed in a C-compatible way so that we can dynamically load it (carefully) in our benchmark runner.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Nov 23 2020 at 20:22):

fitzgen submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 23 2020 at 20:22):

fitzgen created PR Review Comment:

I don't think we need to actually have a new type here. We should be able to pass *mut EngineState out and expect that callers won't know how to access its fields or anything.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 23 2020 at 20:22):

fitzgen submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 23 2020 at 20:22):

fitzgen created PR Review Comment:

Worth noting in a comment that if we ever want to measure more than one instantiation per process, we will probably want to create a new store for each instantiation.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 30 2020 at 04:21):

abrown updated PR #2437 from bench-api to main:

The new crate introduced here, wasmtime-bench-api, creates a shared library, e.g. wasmtime_bench_api.so, for executing Wasm benchmarks using Wasmtime. It allows us to measure several phases separately by exposing engine_compile_module, engine_instantiate_module, and engine_execute_module, which pass around an opaque pointer to the internally initialized state. This state is initialized and freed by engine_create and engine_free, respectively. The API also introduces a way of passing in functions to satisfy the "bench" "start" and "bench" "end" symbols that we expect Wasm benchmarks to import. The API is exposed in a C-compatible way so that we can dynamically load it (carefully) in our benchmark runner.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Dec 08 2020 at 21:39):

abrown updated PR #2437 from bench-api to main:

The new crate introduced here, wasmtime-bench-api, creates a shared library, e.g. wasmtime_bench_api.so, for executing Wasm benchmarks using Wasmtime. It allows us to measure several phases separately by exposing engine_compile_module, engine_instantiate_module, and engine_execute_module, which pass around an opaque pointer to the internally initialized state. This state is initialized and freed by engine_create and engine_free, respectively. The API also introduces a way of passing in functions to satisfy the "bench" "start" and "bench" "end" symbols that we expect Wasm benchmarks to import. The API is exposed in a C-compatible way so that we can dynamically load it (carefully) in our benchmark runner.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Dec 10 2020 at 23:02):

abrown updated PR #2437 from bench-api to main:

The new crate introduced here, wasmtime-bench-api, creates a shared library, e.g. wasmtime_bench_api.so, for executing Wasm benchmarks using Wasmtime. It allows us to measure several phases separately by exposing engine_compile_module, engine_instantiate_module, and engine_execute_module, which pass around an opaque pointer to the internally initialized state. This state is initialized and freed by engine_create and engine_free, respectively. The API also introduces a way of passing in functions to satisfy the "bench" "start" and "bench" "end" symbols that we expect Wasm benchmarks to import. The API is exposed in a C-compatible way so that we can dynamically load it (carefully) in our benchmark runner.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Dec 15 2020 at 17:42):

fitzgen submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 15 2020 at 17:42):

fitzgen has marked PR #2437 as ready for review.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 15 2020 at 17:42):

fitzgen merged PR #2437.


Last updated: Dec 23 2024 at 12:05 UTC