Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add benchmarks using iai-callgrind #805

Merged
merged 1 commit into from
Mar 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions testcrate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ doctest = false
rand_xoshiro = "0.6"
# To compare float builtins against
rustc_apfloat = "0.2.1"
# Really a dev dependency, but dev dependencies can't be optional
iai-callgrind = { version = "0.14.0", optional = true }

[dependencies.compiler_builtins]
path = "../compiler-builtins"
Expand Down Expand Up @@ -47,9 +49,16 @@ no-sys-f16-f64-convert = []
# Skip tests that rely on f16 symbols being available on the system
no-sys-f16 = ["no-sys-f16-f64-convert"]

# Enable icount benchmarks (requires iai-callgrind and valgrind)
icount = ["dep:iai-callgrind"]

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

# NOTE: benchmarks must be run with `--no-default-features` or with
# `-p testcrate`, otherwise the default `compiler-builtins` feature of the
# `compiler_builtins` crate gets activated, resulting in linker errors.

[[bench]]
name = "float_add"
harness = false
Expand Down Expand Up @@ -85,3 +94,8 @@ harness = false
[[bench]]
name = "float_pow"
harness = false

[[bench]]
name = "mem_icount"
harness = false
required-features = ["icount"]
Loading