Skip to content

Commit 7d0fd07

Browse files
authored
feat: add a bench macro to canbench. (#178)
Rather than declaring benchmarks as queries on a canister, we now introduce a special `#[bench]` macro, which offers the following pros: 1. It validates that the benchmark has no parameters. 2. It validates that the benchmark returns a `BenchResult` 3. It namespaces the benchmark with the prefix `__canbench__`. This is particularly useful if a benchmark is added to a production canister, then `canbench` can distinguish which queries are benchmarks.
1 parent 365e279 commit 7d0fd07

File tree

11 files changed

+2016
-116
lines changed

11 files changed

+2016
-116
lines changed

Cargo.lock

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ tempfile = "3.3.0"
2727
test-strategy = "0.3.1"
2828

2929
[workspace]
30-
members = ["benchmarks", "canbench-bin", "canbench-rs"]
30+
members = ["benchmarks", "canbench-bin", "canbench-rs", "canbench-rs-macros"]
3131

3232
[workspace.dependencies]
3333
candid = "0.9.11"

0 commit comments

Comments
 (0)