Skip to content

Export throughput from rust-criterion collector #376

Done

Description

@Lol3rrr

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

Activity

  1. epompeii commented on Apr 22, 2024

    @epompeii
    Member

    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.

  2. jzombie commented on Oct 5, 2025

    @jzombie

    Duplicating my comment from PR #377:

    Perhaps instead of parsing out the output manually, using target/criterion/**/new/benchmark.json might 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"}

  3. epompeii commented on Oct 5, 2025

    @epompeii
    Member

    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:

    1. Keep the plaintext parser for backwards compatibility
    2. Add a JSON parser to the current adapter
    3. Add new features (like throughput) to the JSON parser
    4. Update the docs to recommend using the JSON output
  4. thomaseizinger commented on Oct 15, 2026

    @thomaseizinger

    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?

  5. epompeii commented on Nov 30, 2026

    @epompeii
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions