Rust Benchmarks

Hello everyone!

I want to benchmark vec and vec_deque in Rust and I'm looking to utilize the benchmark code that's already available within Rust.

Does anyone know how to use this?

PATH: and inside rust/library/alloc/benches

Thank you

Whilst in the directory library/alloc, run the command cargo bench to execute the benchmarks in benches. All the current ones are for the collections in alloc.

These are setup in library/alloc/Cargo.toml:

name = "collectionsbenches"
path = "benches/"
test = true

name = "vec_deque_append_bench"
path = "benches/"
harness = false

If you need more control over which benchmarks execute and how they execute, I suggest looking at the docs for cargo bench.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.