A fast and simple benchmarking library for Rust projects with ergonomic macros and detailed performance reports.
Divan is a benchmarking library for Rust designed to be fast and simple to use. It provides ergonomic macros for registering benchmarks and generates detailed performance reports, helping developers measure and optimize code efficiency.
Rust developers who need to measure and optimize the performance of their code, particularly those integrating benchmarks into their standard Cargo workflow.
Developers choose Divan for its ergonomic design that simplifies benchmark setup with intuitive macros and seamless Cargo integration, while providing clear, detailed performance reports that aid in thorough analysis.
Fast and simple benchmarking for Rust projects
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The #[divan::bench] macro simplifies benchmark registration with argument specification, as shown in the fibonacci example with args = [1, 2, 4, 8, 16, 32].
Outputs clear table formats with metrics like fastest, slowest, median, mean times, samples, and iterations, aiding in thorough analysis.
Works directly with cargo bench by setting harness = false in Cargo.toml, fitting naturally into standard Rust development workflows.
Allows benchmarking functions with different input arguments, enabling comprehensive performance testing across multiple cases.
The README states a guide is being worked on, and users must rely on external posts and talks, which can hinder onboarding and advanced usage.
Compared to mature alternatives, Divan lacks features like statistical comparison, baseline tracking, or native support for async benchmarks.
Requires Rust 1.80.0 or later, which may block adoption in projects stuck on older stable versions or specific toolchains.