Skip to content

Improve cgu size estimate#156684

Open
csmoe wants to merge 3 commits into
rust-lang:mainfrom
csmoe:improve-cgu-size-estimate
Open

Improve cgu size estimate#156684
csmoe wants to merge 3 commits into
rust-lang:mainfrom
csmoe:improve-cgu-size-estimate

Conversation

@csmoe
Copy link
Copy Markdown
Contributor

@csmoe csmoe commented May 18, 2026

View all comments

This patch improved walltime with -3% and rss with -120MB in my local benchmark of compiling rust-analyzer repo.

May I request a perf-run r?@bjorn3

@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 May 18, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 18, 2026

r? @mati865

rustbot has assigned @mati865.
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 73 candidates
  • Random selection from 18 candidates

@rustbot rustbot assigned bjorn3 and unassigned mati865 May 18, 2026
@lqd
Copy link
Copy Markdown
Member

lqd commented May 18, 2026

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 18, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 18, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 18, 2026

☀️ Try build successful (CI)
Build commit: 4f3300d (4f3300d930eca8fd67617858ee4961c9cc52c522, parent: a31c27a887b40df16ab9dfb8c9f7924636092509)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (4f3300d): comparison URL.

Overall result: ❌✅ regressions and improvements - BENCHMARK(S) FAILED

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

❗ ❗ ❗ ❗ ❗
Warning ⚠️: The following benchmark(s) failed to build:

  • Job failure

❗ ❗ ❗ ❗ ❗

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
1.9% [0.2%, 8.2%] 13
Regressions ❌
(secondary)
2.2% [0.0%, 7.5%] 10
Improvements ✅
(primary)
-1.5% [-3.4%, -0.7%] 4
Improvements ✅
(secondary)
-1.1% [-2.2%, -0.1%] 2
All ❌✅ (primary) 1.1% [-3.4%, 8.2%] 17

Max RSS (memory usage)

Results (primary 2.0%, secondary 0.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
3.1% [2.2%, 4.6%] 9
Regressions ❌
(secondary)
3.0% [1.7%, 4.6%] 7
Improvements ✅
(primary)
-2.9% [-3.0%, -2.9%] 2
Improvements ✅
(secondary)
-3.0% [-3.7%, -2.3%] 4
All ❌✅ (primary) 2.0% [-3.0%, 4.6%] 11

Cycles

Results (primary 2.7%, secondary 4.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
3.5% [1.8%, 8.5%] 7
Regressions ❌
(secondary)
4.0% [2.6%, 8.0%] 8
Improvements ✅
(primary)
-3.0% [-3.0%, -3.0%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.7% [-3.0%, 8.5%] 8

Binary size

Results (primary 0.6%, secondary 1.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.3% [0.0%, 4.7%] 24
Regressions ❌
(secondary)
2.2% [0.0%, 15.2%] 22
Improvements ✅
(primary)
-0.9% [-4.4%, -0.1%] 11
Improvements ✅
(secondary)
-3.0% [-6.0%, -0.1%] 2
All ❌✅ (primary) 0.6% [-4.4%, 4.7%] 35

Bootstrap: missing data
Artifact size: 400.56 MiB -> 400.65 MiB (0.02%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels May 18, 2026
@csmoe
Copy link
Copy Markdown
Contributor Author

csmoe commented May 18, 2026

The job failed, May I have a retry? @lqd

rustc-perf did generated a report, but not sure if it's the expected one. walltime improved with -5% in mean.

Error while benchmarking job BenchmarkJob {
    id: 36134,
    target: X86_64UnknownLinuxGnu,
    backend: Llvm,
    profile: Opt,
    request_tag: "4f3300d930eca8fd67617858ee4961c9cc52c522",
    benchmark_set: BenchmarkSet(
        0,
    ),
    created_at: 2026-05-18T09:36:03.125470Z,
    status: InProgress {
        started_at: 2026-05-18T10:09:13.752235Z,
        collector_name: "x64-1",
    },
    deque_counter: 4,
    kind: Rustc,
    is_optional: false,
}

Job failed after being dequeued for 3 times

@lqd
Copy link
Copy Markdown
Member

lqd commented May 18, 2026

Sure, I can queue another run for a different commit, otherwise the runner will say that sha1 is already benchmarked. So you may need to rebase or add another empty commit, something like that.

@lqd
Copy link
Copy Markdown
Member

lqd commented May 18, 2026

I'll cc @Kobzol on that job failure though.

@csmoe csmoe force-pushed the improve-cgu-size-estimate branch from 6f2fac7 to 68b4d79 Compare May 18, 2026 12:36
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 18, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@lqd
Copy link
Copy Markdown
Member

lqd commented May 18, 2026

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 18, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 18, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 18, 2026

☀️ Try build successful (CI)
Build commit: 9776c7e (9776c7efb2325c383d1fddfe1df97a52abbd644f, parent: 5ea817c65e4896167300b7d2550781b98da9901a)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (9776c7e): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
1.9% [0.2%, 8.1%] 13
Regressions ❌
(secondary)
2.2% [0.0%, 7.5%] 10
Improvements ✅
(primary)
-1.6% [-3.5%, -0.7%] 4
Improvements ✅
(secondary)
-1.3% [-2.4%, -0.2%] 2
All ❌✅ (primary) 1.1% [-3.5%, 8.1%] 17

Max RSS (memory usage)

Results (primary 1.6%, secondary 2.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.9% [1.3%, 4.8%] 9
Regressions ❌
(secondary)
3.2% [0.7%, 7.5%] 7
Improvements ✅
(primary)
-2.4% [-3.4%, -0.6%] 3
Improvements ✅
(secondary)
-2.6% [-2.6%, -2.6%] 1
All ❌✅ (primary) 1.6% [-3.4%, 4.8%] 12

Cycles

Results (primary 2.7%, secondary 3.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
3.5% [2.0%, 8.7%] 7
Regressions ❌
(secondary)
4.2% [2.3%, 9.5%] 8
Improvements ✅
(primary)
-3.0% [-3.0%, -3.0%] 1
Improvements ✅
(secondary)
-2.5% [-2.5%, -2.5%] 1
All ❌✅ (primary) 2.7% [-3.0%, 8.7%] 8

Binary size

Results (primary 0.7%, secondary 1.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.3% [0.0%, 4.7%] 24
Regressions ❌
(secondary)
2.2% [0.0%, 15.2%] 22
Improvements ✅
(primary)
-1.0% [-4.4%, -0.3%] 10
Improvements ✅
(secondary)
-6.0% [-6.0%, -6.0%] 1
All ❌✅ (primary) 0.7% [-4.4%, 4.7%] 34

Bootstrap: 511.688s -> 512.164s (0.09%)
Artifact size: 400.54 MiB -> 402.63 MiB (0.52%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 18, 2026
@Kobzol
Copy link
Copy Markdown
Member

Kobzol commented May 18, 2026

Rustc itself (the bootstrap benchmark) failed to build on the first try, not sure why, I won't have access to rustc-perf runner logs this week. It could have been a transient issue downloading some rustc dependency from the web.

@csmoe csmoe force-pushed the improve-cgu-size-estimate branch from c383a00 to 295e11c Compare May 19, 2026 05:21
@csmoe
Copy link
Copy Markdown
Contributor Author

csmoe commented May 19, 2026

Another perf-run requested

@Kobzol
Copy link
Copy Markdown
Member

Kobzol commented May 19, 2026

@bors try @rust-timer queue

@rust-timer
Copy link
Copy Markdown
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 19, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 19, 2026

⌛ Trying commit 295e11c with merge aa28d85

To cancel the try build, run the command @bors try cancel.

Workflow: https://github.com/rust-lang/rust/actions/runs/26096412514

rust-bors Bot pushed a commit that referenced this pull request May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf-regression Performance regression. S-waiting-on-perf Status: Waiting on a perf run to be completed. 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.

7 participants