Registry / testing / iai-callgrind

iai-callgrind

JSON →
library0.16.1rscratesunverified

A high-precision benchmarking framework for Rust that uses Callgrind for consistent performance measurements.

# Cargo.toml [dependencies] iai-callgrind = "0.16.1"
INSTALL
IMPORT
SIG · IAI-CALLGRIND
I
iai-callgrind
testingrustv0.16.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

library_benchmark
use iai_callgrind::library_benchmark;

Defines and runs a Callgrind-based benchmark for a Fibonacci function.

use iai_callgrind::{library_benchmark, library_benchmark_group, main}; fn fibonacci(n: u64) -> u64 { match n { 0 => 1, 1 => 1, n => fibonacci(n-1) + fibonacci(n-2), } } #[library_benchmark] #[bench::short(10)] fn bench_fibonacci(n: u64) -> u64 { fibonacci(n) } library_benchmark_group!( name = fib_group; benchmarks = bench_fibonacci ); main!(library_benchmark_groups = fib_group);
Debug
Known issues
gotchaRequires Valgrind/Callgrind to be installed on the system.
fix
Install Valgrind (e.g., `apt install valgrind` on Debian/Ubuntu).
affects: >=0.1.0
Upgrade
Version history
0.16.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
iai-callgrind — cargo add iai-callgrind · libregistry