Skip to content

ci: Run benchmarks in the CI#7779

Open
mattiapitossi wants to merge 30 commits intotokio-rs:masterfrom
mattiapitossi:gungraun-6539
Open

ci: Run benchmarks in the CI#7779
mattiapitossi wants to merge 30 commits intotokio-rs:masterfrom
mattiapitossi:gungraun-6539

Conversation

@mattiapitossi
Copy link
Copy Markdown
Member

@mattiapitossi mattiapitossi commented Dec 17, 2025

Motivation

Starting from issue #6539, I would like to introduce some consistent benchmarks using Gungraun to be able to run benchmarks on the CI. For the moment we don't run any of the benchmarks due to the fact that the Criterion benchmarks use a wall-time approach and cannot considered reliable for a CI.

Solution

The iai-calgrind library is now called gungraun and it's already used by some services (https://github.com/gungraun/gungraun/network/dependents) including Rust's compiler-builtins. I wanted to start with spawn first to understand if we want to proceed in this direction.

Other Considerations

  • Gungraun uses Valgrind which is only supported by Unix, therefore benchmarks on other system can only be run through Docker
  • We are still discussing about whether we want to use Bencher or not

Results

Multiple runs on M1 (Docker)

ct_spawn::group::spawn_rt basic:single_rt()
  Instructions:                        8133|8133                 (No change)
  L1 Hits:                            11844|11844                (No change)
  LL Hits:                               61|61                   (No change)
  RAM Hits:                             433|433                  (No change)
  Total read+write:                   12338|12338                (No change)
  Estimated Cycles:                   27304|27304                (No change)
ct_spawn::group::spawn_rt threaded:multi_rt()
  Instructions:                        7009|7009                 (No change)
  L1 Hits:                             9858|9858                 (No change)
  LL Hits:                              104|104                  (No change)
  RAM Hits:                             273|273                  (No change)
  Total read+write:                   10235|10235                (No change)
  Estimated Cycles:                   19933|19933                (No change)
ct_spawn::group::spawn_rt_100 basic:single_rt()
  Instructions:                      267414|267414               (No change)
  L1 Hits:                           407758|407758               (No change)
  LL Hits:                              340|340                  (No change)
  RAM Hits:                             914|914                  (No change)
  Total read+write:                  409012|409012               (No change)
  Estimated Cycles:                  441448|441448               (No change)
ct_spawn::group::spawn_rt_100 threaded:multi_rt()
  Instructions:                      156427|156427               (No change)
  L1 Hits:                           231658|231659               (-0.00043%) [-1.00000x]
  LL Hits:                              486|485                  (+0.20619%) [+1.00206x]
  RAM Hits:                             699|699                  (No change)
  Total read+write:                  232843|232843               (No change)
  Estimated Cycles:                  258553|258549               (+0.00155%) [+1.00002x]

Gungraun result: Ok. 4 without regressions; 0 regressed; 0 filtered; 4 benchmarks finished in 1.12675s

@mattiapitossi mattiapitossi marked this pull request as draft December 17, 2025 09:00
@Darksonn Darksonn added the A-ci Area: The continuous integration setup label Dec 18, 2025
@mattiapitossi mattiapitossi marked this pull request as ready for review December 25, 2025 09:46
- uses: bencherdev/bencher@main
- name: Run Bencher
run: |
bencher run --adapter rust_gungraun --err "cargo bench --bench ${{ matrix.bench }}"
Copy link
Copy Markdown
Member Author

@mattiapitossi mattiapitossi Dec 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: There's an open discussion on Discord whether we want to use Bencher or not

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can try using bencher. I understand that we need to do something special to set it up. Could you share more details on what is required?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! Technically, it should be enough to create an account on https://bencher.dev/auth/signup and generate an API token. Then, a new secret called BENCHER_API_TOKEN with the API key should be created under repo settings as described here

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

Labels

A-ci Area: The continuous integration setup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants