High-precision, one-shot and consistent benchmarking framework/harness for Rust. All Valgrind tools at your fingertips.
  • Rust 72.1%
  • Roff 25.2%
  • Shell 0.9%
  • Just 0.7%
  • C 0.6%
  • Other 0.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Reynard User 0e23ca3b3d
Some checks failed
Build and Check / Check dependencies (push) Has been cancelled
Build and Check / Check dependencies-1 (push) Has been cancelled
Build and Check / Check minimal version requirements of dependencies (push) Has been cancelled
Build and Check / Check minimal version requirements of dependencies-1 (push) Has been cancelled
Build and Check / Check format and spelling (push) Has been cancelled
Build and Check / Run lints (push) Has been cancelled
Build and Check / Run system tests-7 (push) Has been cancelled
Build and Check / Build with feature powerset-2 (push) Has been cancelled
Build and Check / Common checks (push) Has been cancelled
Build and Check / Linux checks (push) Has been cancelled
Build and Check / Freebsd checks (push) Has been cancelled
Build and Check / Run client request tests (push) Has been cancelled
Build and Check / Run client request tests-1 (push) Has been cancelled
Build and Check / Run client request tests-2 (push) Has been cancelled
Build and Check / Run client request tests-3 (push) Has been cancelled
Build and Check / Run client request tests-4 (push) Has been cancelled
Build and Check / Run system tests (push) Has been cancelled
Build and Check / Basic checks (push) Has been cancelled
Build and Check / Check gungraun json schema (push) Has been cancelled
Build and Check / Docs/ubuntu-latest (push) Has been cancelled
Build and Check / Run system tests-1 (push) Has been cancelled
Build and Check / Release build for targets supported by valgrind (push) Has been cancelled
Build and Check / Release build for targets supported by valgrind-1 (push) Has been cancelled
Build and Check / Release build for targets supported by valgrind-2 (push) Has been cancelled
Build and Check / Release build for targets supported by valgrind-3 (push) Has been cancelled
Build and Check / Run system tests-2 (push) Has been cancelled
Build and Check / Release build for targets supported by valgrind-4 (push) Has been cancelled
Build and Check / Release build for targets supported by valgrind-5 (push) Has been cancelled
Build and Check / Release build for targets supported by valgrind-6 (push) Has been cancelled
Build and Check / Release build for targets supported by valgrind-7 (push) Has been cancelled
Build and Check / Run system tests-3 (push) Has been cancelled
Build and Check / Release build for targets supported by valgrind-8 (push) Has been cancelled
Build and Check / Release build for targets supported by valgrind-9 (push) Has been cancelled
Build and Check / Release build for targets supported by valgrind-10 (push) Has been cancelled
Build and Check / Release build for targets supported by valgrind-11 (push) Has been cancelled
Build and Check / Run system tests-4 (push) Has been cancelled
Build and Check / Release build for targets supported by valgrind-12 (push) Has been cancelled
Build and Check / Release build for targets supported by valgrind-13 (push) Has been cancelled
Build and Check / Release build for targets supported by valgrind-14 (push) Has been cancelled
Build and Check / Release build for targets supported by valgrind-15 (push) Has been cancelled
Build and Check / Run system tests-5 (push) Has been cancelled
Build and Check / Release build for targets supported by valgrind-16 (push) Has been cancelled
Build and Check / Release build for targets supported by valgrind-17 (push) Has been cancelled
Build and Check / Build with feature powerset (push) Has been cancelled
Build and Check / Build with feature powerset-1 (push) Has been cancelled
Build and Check / Run system tests-6 (push) Has been cancelled
Build and Check / Run unit and integrations tests (push) Has been cancelled
Build and Check / Run unit and integrations tests-1 (push) Has been cancelled
Build and Check / Run unit and integrations tests-2 (push) Has been cancelled
Build and Check / Run ui tests (push) Has been cancelled
Build and Check / Build with feature powerset-3 (push) Has been cancelled
Build and Check / Run client request tests-5 (push) Has been cancelled
Build and Check / Run system tests-8 (push) Has been cancelled
Build and Check / Run system tests-9 (push) Has been cancelled
Build and Check / Run system tests-10 (push) Has been cancelled
Build and Check / Run system tests-11 (push) Has been cancelled
Build and Check / Run system tests-12 (push) Has been cancelled
Build and Check / Run system tests-13 (push) Has been cancelled
Build and Check / Run system tests-14 (push) Has been cancelled
Build and Check / Run system tests-15 (push) Has been cancelled
chore: sync dependencies (monorepo)
2026-04-13 10:55:38 +02:00
.bumpversion Bump version v0.18.0 -> v0.18.1 2026-04-10 22:14:41 +02:00
.cargo chore: Add rules to the Justfile for mdbook 2024-08-21 06:42:05 +02:00
.dicts docs: Add documentation, resolve todos, apply minor refactors 2026-03-16 18:24:41 +01:00
.github chore(reqs-test): Fix build for riscv64 2026-03-25 18:24:26 +01:00
benchmark-tests feat(prelude): Make use of the prelude in tests and docs 2026-04-08 05:00:13 +02:00
client-request-tests Bump version v0.18.0 -> v0.18.1 2026-04-10 22:14:41 +02:00
docker chore(reqs-test): Fix build for riscv64 2026-03-25 18:24:26 +01:00
docs chore: sync dependencies (monorepo) 2026-04-12 09:28:47 +02:00
gungraun Bump version v0.18.0 -> v0.18.1 2026-04-10 22:14:41 +02:00
gungraun-macros Bump gungraun-macros version v0.7.2 -> v0.8.0 2026-04-09 01:15:12 +02:00
gungraun-runner fix(slowdown): thread pools are not shutdown and are stuck in hot loop 2026-04-10 20:28:51 +02:00
hooks chore: Add pre-commit and pre-push hooks 2024-01-23 07:55:02 +01:00
schema-gen Bump version v0.18.0 -> v0.18.1 2026-04-10 22:14:41 +02:00
scripts chore(cicd): try fix ci 2026-03-04 19:11:48 +01:00
.clangd feat(client-reqs): Implement macros from helgrind.h header file 2024-01-03 04:07:07 +01:00
.clippy.toml chore(clippy): Use same lints in iai_callgrind and iai_callgrind_runner 2025-08-06 16:38:15 +02:00
.editorconfig format(markdown): In .editorconfig markdown: Remove spaces from line-endings 2024-10-03 09:24:02 +02:00
.gitignore refactor(parallel): Rename Streams -> CapturedOutput 2026-03-17 14:28:01 +01:00
.markdownlint.json Reformat .json .yml with prettier and .toml files with taplo 2023-09-24 12:35:55 +02:00
.perltidyrc chore: Configure editorconfig and perltidy format for perl 2023-10-24 09:12:25 +02:00
.prettierignore chore(format): Improve prettier configuration and usage in justfile 2026-02-16 14:16:52 +01:00
.prettierrc.toml chore(format): Add a prettierrc which sets proseWrap to 80 like in .editorconfig 2026-03-17 15:37:48 +01:00
.taplo.toml chore: Fix taplo config to not reorder keys which are not in the formatting rule 2024-05-07 09:35:47 +02:00
Cargo.lock Bump version v0.18.0 -> v0.18.1 2026-04-10 22:14:41 +02:00
Cargo.toml chore: sync dependencies (monorepo) 2026-04-13 10:55:38 +02:00
CHANGELOG.md chore: Update changelog 2026-04-10 22:12:49 +02:00
CODE_OF_CONDUCT.md format(markdown): Use consistently inline reference-style links 2026-03-17 17:24:42 +01:00
CONTRIBUTING.md docs(CONTRIBUTING): Add usage of AI tools section 2026-03-17 17:26:59 +01:00
Cross.toml migration: change prefix of IAI_CALLGRIND cross variables 2025-09-19 23:45:19 +02:00
cspell.json tests(bench): Update test_bin_bench_parallel fixtures 2026-03-20 13:59:55 +01:00
deny.toml chore(deps): Update polonius to 0.5.0 2026-02-14 17:57:54 +01:00
Justfile chore(just): Fix bump recipe and build gungraun 2026-04-09 01:15:12 +02:00
LICENSE-APACHE Initial migration from bheisler/iai and cleanup 2023-03-08 13:11:51 +01:00
LICENSE-MIT Initial migration from bheisler/iai and cleanup 2023-03-08 13:11:51 +01:00
README.md format(markdown): Use consistently inline reference-style links 2026-03-17 17:24:42 +01:00
renovate.json chore: Update renovate.json 2024-01-04 05:37:56 +01:00
rustfmt.toml chore(format): Use style_edition in rustfmt.toml instead of version 2024-09-22 14:30:10 +02:00
VISION.md chore(format): Reformat markdown files with prettier 2026-02-15 12:57:28 +01:00

Gungraun

High-precision, one-shot and consistent benchmarking framework/harness for Rust. All Valgrind tools at your fingertips.


Gungraun leverages Valgrind's profiling tools like Callgrind, Cachegrind and DHAT to provide extremely accurate and consistent measurements of Rust code, making it perfectly suited to run in environments like a CI. Gungraun aids in analyzing and optimizing code paths from the source code level down to the assembly instruction level.

Gungraun is:

  • Precise: High-precision measurements of Instruction counts, Estimated Cycles and many other metrics allow you to reliably detect very small optimizations and regressions of your code.
  • Consistent: Gungraun can take accurate measurements even in virtualized CI environments and make them comparable between different systems completely negating the noise of the environment.
  • Fast: Each benchmark is only run once, which is usually much faster than benchmarks which measure execution and wall-clock time. Benchmarks measuring the wall-clock time have to be run many times to increase their accuracy, detect outliers, filter out noise, etc.
  • Visualizable: Gungraun generates a Callgrind (DHAT, ...) profile of the benchmarked code and can be configured to create flamegraph-like charts from Callgrind metrics. In general, all Valgrind-compatible tools like callgrind_annotate, kcachegrind or dh_view.html and others to analyze the results in detail are fully supported.
  • Easy: The API for setting up benchmarks is easy to use and allows you to quickly create concise and clear benchmarks. Focus more on profiling and your code than on the framework.

See the guide and api documentation at docs.rs for all the details.

Quickstart/Documentation

To get started read the guide and see some introductory examples in Quickstart for library benchmarks or Quickstart for binary benchmarks. A small migration check-list can be found in the Guide.

If you need help or have questions, don't hesitate to open an issue or a discussion

Design philosophy and goals

Gungraun benchmarks are designed to be runnable with cargo bench. The benchmark files are expanded to a benchmarking harness which replaces the native benchmark harness of Rust. Gungraun is a benchmarking and profiling framework that can quickly and reliably detect performance regressions and optimizations even in noisy environments with a precision that is impossible to achieve with wall-clock time based benchmarks. At the same time, we want to abstract the complicated parts and repetitive tasks away and provide an easy to use and intuitive api. Gungraun tries to stay out of your way and applies sensible default settings so you can focus more on profiling and your code!

How far are we?

Gungraun is in a mature development stage and is already in use. Nevertheless, you may experience big changes between a minor version bump. The main profiling tools Callgrind, Cachegrind and DHAT are fully integrated, with full support for benchmarking async, multi-threaded and multi-process applications. Please read our Vision to learn more about the ideas and the direction the future path might take.

When not to use Gungraun

Although Gungraun is useful in many projects, there are cases where Gungraun is not a good fit.

  • If you need wall-clock times, Gungraun cannot help you much. The estimation of cpu cycles merely correlates to wall-clock times but is not a replacement for wall-clock times. The cycles estimation is primarily designed to be a relative metric to be used for comparison.
  • Gungraun cannot be run on Windows and platforms not supported by Valgrind.

Contributing

Thanks for helping to improve this project! A guideline about contributing to Gungraun can be found in the CONTRIBUTING.md file.

You have an idea for a new feature, are missing a functionality or have found a bug? Open an issue.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as in License, without any additional terms or conditions.

Pronunciation and origin of Gungraun

Like valgrind, the name has its roots in old norse mythology and is a composition of two words. The first is gungnir, Odin's legendary spear, in the sense of one shot (benchmark execution) and one hit never missing its target. The second word is raun which simply means test.

The first syllable is pronounced like the english word gun. The second g is silent. The last syllable raun can be pronounced like the english word rain.

  • Criterion-rs: A Statistics-driven benchmarking library for Rust. Wall-clock times based benchmarks.
  • hyperfine: A command-line benchmarking tool. Wall-clock time based benchmarks.
  • divan: Statistically-comfy benchmarking library. Wall-clock times based benchmarks.
  • dhat-rs: Provides heap profiling and ad hoc profiling capabilities to Rust programs, similar to those provided by DHAT.
  • cargo-valgrind: A cargo subcommand, that runs valgrind and collects its output in a helpful manner.

Credits

Gungraun is forked from https://github.com/bheisler/iai and the original idea is from Brook Heisler (@bheisler).

Gungraun is powered by Valgrind.

License

Gungraun is like Iai dual licensed under the Apache 2.0 license and the MIT license at your option.

According to Valgrind's documentation:

The Valgrind headers, unlike most of the rest of the code, are under a BSD-style license, so you may include them without worrying about license incompatibility.

We have included the original license where we made use of the original header files.