Skip to content

Take first task group for further execution#154419

Open
zetanumbers wants to merge 1 commit intorust-lang:mainfrom
zetanumbers:take-first-group
Open

Take first task group for further execution#154419
zetanumbers wants to merge 1 commit intorust-lang:mainfrom
zetanumbers:take-first-group

Conversation

@zetanumbers
Copy link
Contributor

@zetanumbers zetanumbers commented Mar 26, 2026

Continuing from #153768 (comment).

I thought that storing a first group of tasks for immediate execution instead of pushing and immediately poping it from rayon's local task queue in par_slice would avoid overwhelming work stealing potentially blocking the original thread. So I've implemented this change.

8 threads benchmarks:

Benchmarkbaseline~~9new~take-first-group~1
TimeTime%
🟣 hyper:check0.1110s0.1086s💚 -2.13%
🟣 hyper:check:initial0.1314s0.1298s💚 -1.23%
🟣 hyper:check:unchanged0.0771s0.0755s💚 -2.14%
🟣 clap:check0.3787s0.3757s -0.80%
🟣 clap:check:initial0.4680s0.4564s💚 -2.48%
🟣 clap:check:unchanged0.2337s0.2301s💚 -1.52%
🟣 syn:check0.4321s0.4265s💚 -1.31%
🟣 syn:check:initial0.5586s0.5401s💚 -3.31%
🟣 syn:check:unchanged0.3434s0.3429s -0.14%
🟣 regex:check0.2755s0.2661s💚 -3.40%
🟣 regex:check:initial0.3350s0.3347s -0.11%
🟣 regex:check:unchanged0.1851s0.1832s💚 -1.01%
Total3.5296s3.4695s💚 -1.70%
Summary1.0000s0.9837s💚 -1.63%

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 26, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 26, 2026

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 69 candidates
  • Random selection from 11 candidates

@lqd
Copy link
Member

lqd commented Mar 26, 2026

I wonder what variance, and noise level, you're seeing on your benchmarking machine? BTZ, does this remove some small overhead a few times, or does it translate to good results on bigger benchmarks as well?

@jieyouxu
Copy link
Member

@rustbot reroll

@rustbot rustbot assigned nnethercote and unassigned jieyouxu Mar 26, 2026
@zetanumbers
Copy link
Contributor Author

zetanumbers commented Mar 26, 2026

I wonder what variance, and noise level, you're seeing on your benchmarking machine? BTZ, does this remove some small overhead a few times, or does it translate to good results on bigger benchmarks as well?

Here's baseline compiler running against itself:

Benchmarkbaseline~~9baseline~~9
TimeTime%
🟣 hyper:check0.1143s0.1157s💔 1.25%
🟣 hyper:check:initial0.1405s0.1420s💔 1.08%
🟣 hyper:check:unchanged0.0805s0.0797s💚 -1.02%
🟣 clap:check0.3914s0.3909s -0.14%
🟣 clap:check:initial0.4765s0.4823s💔 1.21%
🟣 clap:check:unchanged0.2345s0.2329s -0.68%
🟣 syn:check0.4328s0.4303s -0.58%
🟣 syn:check:initial0.5820s0.5731s💚 -1.53%
🟣 syn:check:unchanged0.3695s0.3696s 0.02%
🟣 regex:check0.2668s0.2720s💔 1.95%
🟣 regex:check:initial0.3224s0.3289s💔 2.02%
🟣 regex:check:unchanged0.1901s0.1846s💚 -2.92%
Total3.6015s3.6021s 0.02%
Summary1.0000s1.0006s 0.06%

I have run these benchmarks on various changes before and never seen all greens like above.

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

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants