Skip to content

A first benchmark: Putting things on the dispatcher#3320

Merged
badboy merged 1 commit intomainfrom
push-ykxryxotquvz
Nov 19, 2025
Merged

A first benchmark: Putting things on the dispatcher#3320
badboy merged 1 commit intomainfrom
push-ykxryxotquvz

Conversation

@badboy
Copy link
Copy Markdown
Member

@badboy badboy commented Nov 11, 2025

This sets up criterion, a statistics-driven micro-benchmarking tool. It also adds a first simple benchmark: Launching tasks on the global dispatcher.


Needs some docs I guess.
The way I've been running this:

On this commit:

cargo bench -p glean-core --bench dispatcher -- --save-baseline bn

Then on later commits (e.g. #3318)

cargo bench -p glean-core --bench dispatcher -- --baseline bn

results in output like this:

   Compiling glean-core v66.1.1 (/home/jer/src/mozilla/glean/glean-core)
    Finished `bench` profile [optimized] target(s) in 18.62s
     Running benches/dispatcher.rs (target/release/deps/dispatcher-b3ccfcc39ee552d0)
empty fn                time:   [61.181 ns 61.231 ns 61.285 ns]
                        change: [−23.764% −23.575% −23.390%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 13 outliers among 100 measurements (13.00%)
  5 (5.00%) low severe
  3 (3.00%) low mild
  2 (2.00%) high mild
  3 (3.00%) high severe

fn 1024                 time:   [431.57 ns 432.26 ns 432.99 ns]
                        change: [−44.413% −34.742% −23.066%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild

@badboy badboy force-pushed the push-ykxryxotquvz branch 3 times, most recently from b757924 to 1328f2b Compare November 12, 2025 11:21
Comment thread glean-core/src/lib.rs
@badboy badboy marked this pull request as ready for review November 12, 2025 11:23
@badboy badboy requested a review from a team as a code owner November 12, 2025 11:23
@badboy badboy requested review from chutten and removed request for a team November 12, 2025 11:23
Comment thread supply-chain/config.toml
Copy link
Copy Markdown
Contributor

@chutten chutten left a comment

Choose a reason for hiding this comment

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

What do the perf folks think?

Comment thread bin/benchmark-compare.sh Outdated
Comment thread glean-core/benches/dispatcher.rs
Comment thread glean-core/benches/dispatcher.rs
Comment thread glean-core/src/lib.rs
This sets up criterion, a statistics-driven micro-benchmarking tool.
It also adds a first simple benchmark: Launching tasks on the global
dispatcher.

Also included is a helper script to run a benchmark comparison.
@badboy badboy enabled auto-merge (rebase) November 19, 2025 10:25
@badboy badboy merged commit 4c03f57 into main Nov 19, 2025
27 of 28 checks passed
@badboy badboy deleted the push-ykxryxotquvz branch November 19, 2025 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants