Skip to content

Commit 88cdab9

Browse files
committed
chore: use criterion for benchmark
1 parent 922718c commit 88cdab9

2 files changed

Lines changed: 65 additions & 2 deletions

File tree

.github/workflows/benchmark.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
with:
7070
# TODO(template) update the name to match your project
7171
name: Benchmark
72-
tool: "cargo"
72+
tool: "criterion"
7373
output-file-path: benchmark-output.txt
7474
external-data-json-path: ./cache/benchmark-data.json
7575
alert-threshold: "130%"
@@ -84,7 +84,7 @@ jobs:
8484
with:
8585
# TODO(template) update the name to match your project
8686
name: Rust Template Benchmark
87-
tool: "cargo"
87+
tool: "criterion"
8888
output-file-path: benchmark-output.txt
8989
gh-pages-branch: gh-pages
9090
benchmark-data-dir-path: dev/bench

benchmark-output.txt

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
Finished `bench` profile [optimized] target(s) in 0.16s
2+
Running unittests src/bin/addition.rs (target/release/deps/addition-fa126c1aa49f239a)
3+
4+
running 0 tests
5+
6+
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
7+
8+
Running unittests src/lib.rs (target/release/deps/template_crate-2cbe50dadcac1ec1)
9+
10+
running 4 tests
11+
test tests::addition_bound_check ... ignored
12+
test tests::addition_edge_case ... ignored
13+
test tests::addition_of_bounded ... ignored
14+
test tests::addition_proptest ... ignored
15+
16+
test result: ok. 0 passed; 0 failed; 4 ignored; 0 measured; 0 filtered out; finished in 0.00s
17+
18+
Running benches/benchmark.rs (target/release/deps/benchmark-32b0b63a53acd575)
19+
Gnuplot not found, using plotters backend
20+
Benchmarking add_small_integers valid
21+
Benchmarking add_small_integers valid: Warming up for 3.0000 s
22+
Benchmarking add_small_integers valid: Collecting 100 samples in estimated 5.0000 s (6.1B iterations)
23+
Benchmarking add_small_integers valid: Analyzing
24+
add_small_integers valid
25+
time: [825.17 ps 827.48 ps 829.74 ps]
26+
change: [-1.0534% -0.7769% -0.4984%] (p = 0.00 < 0.05)
27+
Change within noise threshold.
28+
Found 2 outliers among 100 measurements (2.00%)
29+
1 (1.00%) low mild
30+
1 (1.00%) high mild
31+
32+
Benchmarking add_small_integers bound check
33+
Benchmarking add_small_integers bound check: Warming up for 3.0000 s
34+
Benchmarking add_small_integers bound check: Collecting 100 samples in estimated 5.0000 s (4.5B iterations)
35+
Benchmarking add_small_integers bound check: Analyzing
36+
add_small_integers bound check
37+
time: [1.0951 ns 1.0977 ns 1.1004 ns]
38+
change: [-1.0440% -0.7332% -0.4399%] (p = 0.00 < 0.05)
39+
Change within noise threshold.
40+
Found 2 outliers among 100 measurements (2.00%)
41+
2 (2.00%) high mild
42+
43+
Benchmarking sub_small_integers valid
44+
Benchmarking sub_small_integers valid: Warming up for 3.0000 s
45+
Benchmarking sub_small_integers valid: Collecting 100 samples in estimated 5.0000 s (6.1B iterations)
46+
Benchmarking sub_small_integers valid: Analyzing
47+
sub_small_integers valid
48+
time: [822.88 ps 825.16 ps 827.40 ps]
49+
change: [-1.9918% -1.7085% -1.4029%] (p = 0.00 < 0.05)
50+
Performance has improved.
51+
Found 5 outliers among 100 measurements (5.00%)
52+
3 (3.00%) low mild
53+
2 (2.00%) high mild
54+
55+
Benchmarking sub_small_integers bound check
56+
Benchmarking sub_small_integers bound check: Warming up for 3.0000 s
57+
Benchmarking sub_small_integers bound check: Collecting 100 samples in estimated 5.0000 s (6.0B iterations)
58+
Benchmarking sub_small_integers bound check: Analyzing
59+
sub_small_integers bound check
60+
time: [824.80 ps 826.50 ps 828.18 ps]
61+
change: [-1.8074% -1.4830% -1.1346%] (p = 0.00 < 0.05)
62+
Performance has improved.
63+

0 commit comments

Comments
 (0)