Rustbench
rustbench
is a lightweight Rust procedural macro for benchmarking function execution time.
Installation
To use rustbench
, add it to your Cargo.toml
:
[]
= "0.1.0"
Then, add the macro as a procedural macro dependency:
[]
= true
Usage
Simply annotate any function with #[benchmark]
to measure its execution time.
use benchmark;
Output
When sum
runs, it prints the execution time:
Function sum executed in 12.3ms
Features (Planned)
- Custom Iterations: Run the function multiple times for better measurement.
- Comparison Mode: Compare execution time of two functions.
- Output Formats: JSON, CSV, or plain text.
- Memory Profiling: Measure memory usage during execution.
- Integration with Logging: Store benchmark results in logs.