Binggan

Binggan (ι€ δΉΎ, bΗng gΔn, means cookie in Chinese) is a benchmarking library for Rust. It is designed to be simple to use and to provide a good overview of the performance of your code and its memory consumption.
Features
- π Peak Memory Usage
- π Stack Offset Randomization
- π Perf Integration (Linux)
- π Delta Comparison
- β‘ Fast Execution
- π Interleaving Test Runs (More accurate results)
- π·οΈ Named Runs, Groups and Benchmarks
- π§ No Macros, No Magic (Just a regular API)
- π¦ Runs on Stable Rust
- π Custom reporter
- π§© Report output of benchmarks
- π Plugin System
- π¨ NOW with colored output!
Example
use ;
pub static GLOBAL: & = &INSTRUMENTED_SYSTEM;
Example Output
) )
) )
) )
) )
) )
) )
Peak Memory
To activate peak memory reporting, you need to wrap your allocator with the PeakMemAlloc and call set_alloc in the group.
While number of allocations are also interesting for performance analysis, peak memory will determine the memory requirements of the code.
Perf Integration
Perf may run into limitations where all counters are reported as zero. https://github.com/jimblandy/perf-event/issues/2 Disabling the NMI watchdog should help:
sudo sh -c "echo '0' > /proc/sys/kernel/nmi_watchdog"
TODO
- Improve the reporter api. Currently the reporter gets preaggregated data.
Maybe Later Features:
- Charts
- Auto comparison of Histograms (e.g. if a benchmark has several bands in which it operates, it would be nice to compare them)