diff options
| author | Henry Gressmann <mail@henrygressmann.de> | 2024-01-29 23:12:20 +0100 |
|---|---|---|
| committer | Henry Gressmann <mail@henrygressmann.de> | 2024-01-29 23:12:20 +0100 |
| commit | 4919d8c2f86f69f669a1afba2a28d5c344fe7197 (patch) | |
| tree | 02f4b0747ee217ddf59fdc459a2083a95961a557 /BENCHMARKS.md | |
| parent | 963ddd26a89490458e31d9d553dffafe5e350e96 (diff) | |
perf: improve benchmarks
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'BENCHMARKS.md')
| -rw-r--r-- | BENCHMARKS.md | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/BENCHMARKS.md b/BENCHMARKS.md new file mode 100644 index 0000000..c86679c --- /dev/null +++ b/BENCHMARKS.md @@ -0,0 +1,42 @@ +# Benchmark results + +All benchmarks are run on a Ryzen 7 5800X, with 32GB of RAM, running Linux 6.6 with `intel_pstate=passive split_lock_detect=off mitigations=off`. + +## Results + +Coming soon. + +## WebAssembly Settings + +All WebAssembly files are compiled with the following settings: + +- `opt-level` is set to 3, `lto` is set to `thin`, `codegen-units` is set to 1. +- `reference-types`, `bulk-memory`, `mutable-globals` proposals are enabled. + +## Runtime Settings + +All runtimes are compiled with the following settings: + +- `unsafe` features are enabled +- `opt-level` is set to 3, `lto` is set to `thin`, `codegen-units` is set to 1. + +# Running benchmarks + +Benchmarks are run using [Criterion.rs](https://github.com/bheisler/criterion.rs). To run a benchmark, use the following command: + +```sh +$ cargo bench --bench <name> +``` + +## Profiling + +To profile a benchmark, use the following command: + +```sh +$ cargo flamegraph --bench <name> -- --bench +``` + +This will generate a flamegraph in `flamegraph.svg` and a `perf.data` file. +You can use [hotspot](https://github.com/KDAB/hotspot) to analyze the `perf.data` file. +Since a lot of functions are inlined, you probably want to remove the `#[inline]` attribute from the functions you care about. +Note that this will make the benchmark considerably slower, 2-10x slower in some cases. |
