You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Export throughput from rust-criterion collector #376
Currently it seems like you can only export the latency for rust criterion benchmarks. However I would also find it quite useful to track the overall throughput measured in the benchmarks.
I understand that there might be some complications as criterions throughput measurements are opt-in, but it still seems like a nice feature to have.
If this is not too big/difficult I would have no problem with implementing this myself as well
It shouldn't be too hard to add. It will require having up to two Measures for the adapter, so it can also parse thrpt: [164.95 MiB/s 166.14 MiB/s 167.10 MiB/s] etc.
For backwards compatibility reasons, we will still need to parse the plaintext output.
I'm a bit torn about whether it's therefore worth it to add a second parser or not.
One of my design goals with Bencher is that things should "just work". So I was initially hesitant to require JSON output. However, I ended up needing to use the JSON output for some of the other benchmark harnesses that Bencher supports, and a JSON parser is a much more robust solution.
My current inclination is that we:
Keep the plaintext parser for backwards compatibility
Add a JSON parser to the current adapter
Add new features (like throughput) to the JSON parser
Update the docs to recommend using the JSON output
As far as I understand, bare-metal image runs would only see the plaintext output, right? So I think we'd have to extend the plaintext parser to in order to offer that functionality there?
Also, the currently built-in Througput measure is op/s. How should we map a throughput of say Gb/s to that?
Shipped in v0.6.19: at BMF version 1, the rust_criterion adapter stores the thrpt: throughput, from both the text output and the cargo-criterion JSON messages.
Activity
epompeii commentedon Apr 22, 2024
Hey @Lol3rrr,
I'm definitely open to a PR to add this functionality: https://bheisler.github.io/criterion.rs/book/user_guide/advanced_configuration.html#throughput-measurements
It shouldn't be too hard to add. It will require having up to two Measures for the adapter, so it can also parse
thrpt: [164.95 MiB/s 166.14 MiB/s 167.10 MiB/s]etc.jzombie commentedon Oct 5, 2025
Duplicating my comment from PR #377:
Perhaps instead of parsing out the output manually, using
target/criterion/**/new/benchmark.jsonmight provide more reliable feedback:You'll get something like this, per benchmark:
{"group_id":"hash_join_inner_join","function_id":null,"value_str":"100000","throughput":{"Elements":100000},"full_id":"hash_join_inner_join/100000","directory_name":"hash_join_inner_join/100000","title":"hash_join_inner_join/100000"}epompeii commentedon Oct 5, 2025
Hey @jzombie , I'm definitely open to also parsing the JSON output: https://bheisler.github.io/criterion.rs/book/cargo_criterion/external_tools.html#json-messages
For backwards compatibility reasons, we will still need to parse the plaintext output.
I'm a bit torn about whether it's therefore worth it to add a second parser or not.
One of my design goals with Bencher is that things should "just work". So I was initially hesitant to require JSON output. However, I ended up needing to use the JSON output for some of the other benchmark harnesses that Bencher supports, and a JSON parser is a much more robust solution.
My current inclination is that we:
thomaseizinger commentedon Oct 15, 2026
As far as I understand, bare-metal image runs would only see the plaintext output, right? So I think we'd have to extend the plaintext parser to in order to offer that functionality there?
Also, the currently built-in Througput measure is op/s. How should we map a throughput of say Gb/s to that?
Parse the Rust harnesses at BMF version 1 (#1351)
epompeii commentedon Nov 30, 2026
Shipped in v0.6.19: at BMF version 1, the
rust_criterionadapter stores thethrpt:throughput, from both the text output and the cargo-criterion JSON messages.