Skip to content

Commit 5d50a12

Browse files
committed
bench: Update the benchmark runner to gungraun 0.17
`iai-callgrind` was renamed to `gungraun` and had a new release. Update everything to match. There shouldn't be any functional changes here.
1 parent acb3a00 commit 5d50a12

File tree

6 files changed

+28
-22
lines changed

6 files changed

+28
-22
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@ codegen-units = 1
5151
lto = "fat"
5252

5353
[profile.bench]
54-
# Required for iai-callgrind
54+
# Required for gungraun
5555
debug = true

builtins-test/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ rand_xoshiro = "0.7"
1414
# To compare float builtins against
1515
rustc_apfloat = "0.2.3"
1616
# Really a dev dependency, but dev dependencies can't be optional
17-
iai-callgrind = { version = "0.15.2", optional = true }
17+
gungraun = { version = "0.17.0", optional = true }
1818

1919
[dependencies.compiler_builtins]
2020
path = "../builtins-shim"
@@ -46,8 +46,8 @@ no-sys-f16-f64-convert = []
4646
# Skip tests that rely on f16 symbols being available on the system
4747
no-sys-f16 = ["no-sys-f16-f64-convert"]
4848

49-
# Enable icount benchmarks (requires iai-callgrind and valgrind)
50-
icount = ["dep:iai-callgrind"]
49+
# Enable icount benchmarks (requires gungraun-runner and valgrind locally)
50+
icount = ["dep:gungraun"]
5151

5252
# Enable report generation without bringing in more dependencies by default
5353
benchmarking-reports = ["criterion/plotters", "criterion/html_reports"]

builtins-test/benches/mem_icount.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
//! Benchmarks that use Callgrind (via `iai_callgrind`) to report instruction count metrics. This
1+
//! Benchmarks that use Callgrind (via `gungraun`) to report instruction count metrics. This
22
//! is stable enough to be tested in CI.
33
44
use std::hint::black_box;
55
use std::{ops, slice};
66

77
use compiler_builtins::mem::{memcmp, memcpy, memmove, memset};
8-
use iai_callgrind::{library_benchmark, library_benchmark_group, main};
8+
use gungraun::{library_benchmark, library_benchmark_group, main};
99

1010
const PAGE_SIZE: usize = 0x1000; // 4 kiB
1111
const MAX_ALIGN: usize = 512; // assume we may use avx512 operations one day

ci/bench-icount.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if [ -z "$target" ]; then
1010
target="$host_target"
1111
fi
1212

13-
iai_home="iai-home"
13+
gungraun_home="iai-home"
1414

1515
# Use the arch as a tag to disambiguate artifacts
1616
tag="$(echo "$target" | cut -d'-' -f1)"
@@ -26,19 +26,19 @@ function run_icount_benchmarks() {
2626
"--features" "unstable,unstable-float,icount"
2727
)
2828

29-
iai_args=(
30-
"--home" "$(pwd)/$iai_home"
29+
gungraun_args=(
30+
"--home" "$(pwd)/$gungraun_home"
3131
"--callgrind-limits=ir=5.0"
3232
"--save-summary"
3333
)
3434

35-
# Parse `cargo_arg0 cargo_arg1 -- iai_arg0 iai_arg1` syntax
36-
parsing_iai_args=0
35+
# Parse `cargo_arg0 cargo_arg1 -- gungraun_arg0 gungraun_arg1` syntax
36+
parsing_gungraun_args=0
3737
while [ "$#" -gt 0 ]; do
38-
if [ "$parsing_iai_args" == "1" ]; then
39-
iai_args+=("$1")
38+
if [ "$parsing_gungraun_args" == "1" ]; then
39+
gungraun_args+=("$1")
4040
elif [ "$1" == "--" ]; then
41-
parsing_iai_args=1
41+
parsing_gungraun_args=1
4242
else
4343
cargo_args+=("$1")
4444
fi
@@ -48,7 +48,7 @@ function run_icount_benchmarks() {
4848

4949
# Run iai-callgrind benchmarks. Do this in a subshell with `&& true` to
5050
# capture rather than exit on error.
51-
(cargo bench "${cargo_args[@]}" -- "${iai_args[@]}") && true
51+
(cargo bench "${cargo_args[@]}" -- "${gungraun_args[@]}") && true
5252
exit_code="$?"
5353

5454
if [ "$exit_code" -eq 0 ]; then
@@ -68,4 +68,4 @@ run_icount_benchmarks -- --save-baseline=hardfloat
6868
# Name and tar the new baseline
6969
name="baseline-icount-$tag-$(date -u +'%Y%m%d%H%M')-${GITHUB_SHA:0:12}"
7070
echo "BASELINE_NAME=$name" >>"$GITHUB_ENV"
71-
tar cJf "$name.tar.xz" "$iai_home"
71+
tar cJf "$name.tar.xz" "$gungraun_home"

libm-test/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ build-musl = ["dep:musl-math-sys"]
2121
# Enable report generation without bringing in more dependencies by default
2222
benchmarking-reports = ["criterion/plotters", "criterion/html_reports"]
2323

24-
# Enable icount benchmarks (requires iai-callgrind and valgrind)
25-
icount = ["dep:iai-callgrind"]
24+
# Enable icount benchmarks (requires gungraun-runner and valgrind locally)
25+
icount = ["dep:gungraun"]
2626

2727
# Run with a reduced set of benchmarks, such as for CI
2828
short-benchmarks = []
@@ -31,7 +31,7 @@ short-benchmarks = []
3131
anyhow = "1.0.98"
3232
# This is not directly used but is required so we can enable `gmp-mpfr-sys/force-cross`.
3333
gmp-mpfr-sys = { version = "1.6.5", optional = true, default-features = false }
34-
iai-callgrind = { version = "0.15.2", optional = true }
34+
gungraun = { version = "0.17.0", optional = true }
3535
indicatif = { version = "0.18.0", default-features = false }
3636
libm = { path = "../libm", features = ["unstable-public-internals"] }
3737
libm-macros = { path = "../crates/libm-macros" }

libm-test/benches/icount.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
//! Benchmarks that use `iai-cachegrind` to be reasonably CI-stable.
1+
//! Benchmarks that use `gungraun` to be reasonably CI-stable.
22
#![feature(f16)]
33
#![feature(f128)]
44

55
use std::hint::black_box;
66

7-
use iai_callgrind::{library_benchmark, library_benchmark_group, main};
7+
use gungraun::{library_benchmark, library_benchmark_group, main};
88
use libm::support::{HInt, Hexf, hf16, hf32, hf64, hf128, u256};
99
use libm_test::generate::spaced;
1010
use libm_test::{CheckBasis, CheckCtx, GeneratorKind, MathOp, OpRustArgs, TupleCall, op};
@@ -156,7 +156,13 @@ fn icount_bench_u256_shr(cases: Vec<(u256, u32)>) {
156156

157157
library_benchmark_group!(
158158
name = icount_bench_u128_group;
159-
benchmarks = icount_bench_u128_widen_mul, icount_bench_u256_narrowing_div, icount_bench_u256_add, icount_bench_u256_sub, icount_bench_u256_shl, icount_bench_u256_shr
159+
benchmarks =
160+
icount_bench_u128_widen_mul,
161+
icount_bench_u256_narrowing_div,
162+
icount_bench_u256_add,
163+
icount_bench_u256_sub,
164+
icount_bench_u256_shl,
165+
icount_bench_u256_shr
160166
);
161167

162168
#[library_benchmark]

0 commit comments

Comments
 (0)