Closed mateuszmlc closed 1 year ago
We can provide a nicer interface for benchmarking by implementing proc-macros like so: ``` use benchy::benchmark; #[benchmark("fib", [ ("1 byte", 1), ("10 bytes", 10) ])] fn fib(b: &mut BenchmarkRun, n: u32) { ... } benchy::main!(); ``` This also makes it more obvious that you shouldn't share state between benchmark runs, as the functions get run in a forked process, to get accurate memory usage metrics.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
zk-benchmarks | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Sep 14, 2023 5:50pm |
Considering renaming bench::bench to benchmark
so that it doesn't conflict with Rust's #[bench]
attribute, because the error message is confusing if you forget to import use bench::bench
.
Includes #26.
Went with
bench::main!(assert, fib, sha256, ...);
instead of justbench::main!()
because static-constructors/ctors (running init code before main) is not supported in WASM (or LLVM -> WASM rather) yet