benchmarker
A simple and efficient benchmarking tool for Rust functions.
Features
- Easy-to-use macro for benchmarking functions
- Measures execution time and calculates statistics
- Supports multiple iterations for accurate results
- Customizable number of warmup rounds
Usage
Add this to your Cargo.toml:
[]
= "0.4.38"
= "0.5.4"
= "0.5.4"
= "*"
Then, you can use the bench macro to benchmark your functions:
static GLOBAL: Jemalloc = Jemalloc;
use benchmark;
output:
Entering function: test_benchmark
Exiting function: test_benchmark memory used: 1732224 bytes
Number of primes up to 1000000: 78498
This will print the average time taken to execute the function and memory statistics.
License
This project is licensed under the MIT License. See the LICENSE file for more details.