Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Rust example for benchmarking with cargo bench

This directory shows how to use github-action-benchmark with cargo bench.

Run benchmarks

Official documentation for usage of cargo bench:


- name: Run benchmark
  run: cargo +nightly bench | tee output.txt

Note that cargo bench is available only with nightly toolchain.

Note that this example does not use LTO for benchmarking because entire code in benchmark iteration will be removed as dead code. For normal use case, please enable it in Cargo.toml for production performance.

lto = true

Process benchmark results

Store the benchmark results with step using the action. Please set cargo to tool input.

- name: Store benchmark result
  uses: rhysd/github-action-benchmark@v1
    tool: 'cargo'
    output-file-path: output.txt

Please read 'How to use' section for common usage.

You can’t perform that action at this time.