Rust: How to run benchmark tests
Crazcalm's Tech Stack
We will go over two different ways of running benchmark tests in Rust. The first way is to use nightly Rust to run benchmark tests via the standard library's test crate. The second way to run your benchmark tests is to use the Criterion crate.
Links:
Benchmark (Wiki): https://en.wikipedia.org/wiki/Benchmark_(computing)
Rust Test crate docs: https://doc.rust-lang.org/test/index.html
Benchmark test example (The Rust Unstable Book): https://doc.rust-lang.org/unstable-book/library-features/test.html?highlight=feature#test
Extern keyword docs: https://doc.rust-lang.org/std/keyword.extern.html
Rustup for managing Rust versions: https://doc.rust-lang.org/nightly/edition-guide/rust-2018/rustup-for-managing-rust-versions.html
Cargo test docs (The Cargo Book): https://doc.rust-lang.org/cargo/commands/cargo-test.html
Criterion crate: https://crates.io/crates/criterion
Criterion blog post I referenced: https://bheisler.github.io/post/benchmarking-with-criterion-rs/
My social links:
109650617 Bytes