Skip to content

Optimize Clippy with PGO#159642

Draft
Kobzol wants to merge 3 commits into
rust-lang:mainfrom
Kobzol:bootstrap-pgo-clippy
Draft

Optimize Clippy with PGO#159642
Kobzol wants to merge 3 commits into
rust-lang:mainfrom
Kobzol:bootstrap-pgo-clippy

Conversation

@Kobzol

@Kobzol Kobzol commented Jul 21, 2026

Copy link
Copy Markdown
Member

View all comments

After rustdoc and Cargo, this seemed like an obvious target for PGO.

Perf results: https://perf.rust-lang.org/compare.html?start=390279b302ca98ae270f434100ae3730531d1246&end=caf67342a544d6eab7a40ebf0d02e802f62008a4&stat=instructions:u

The Clippy benchmarks are not that fast, the full time duration is now ~3h 20m. Maybe we should wait for Mark's new try build hardware before landing this, but it is borderline.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Jul 21, 2026
@Kobzol

Kobzol commented Jul 21, 2026

Copy link
Copy Markdown
Member Author

@bors try

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 21, 2026
@Kobzol

Kobzol commented Jul 21, 2026

Copy link
Copy Markdown
Member Author

@rust-timer queue profiles=Check,Debug,Opt,Doc,Clippy

@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 Jul 21, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-bors

rust-bors Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 2dc0eb1 failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

@Kobzol
Kobzol force-pushed the bootstrap-pgo-clippy branch from 2517a15 to f2e4e7c Compare July 21, 2026 11:14
@Kobzol

Kobzol commented Jul 21, 2026

Copy link
Copy Markdown
Member Author

@bors try

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 21, 2026
@rust-bors

rust-bors Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 3542ef2 (3542ef25e63b309ca2515102fb81bc590cbabcef)
Base parent: cde3f8a (cde3f8aee5a30928872e2438e3f18238a3fa306c)

@rust-timer

This comment has been minimized.

Comment thread src/tools/opt-dist/src/main.rs Outdated
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (3542ef2): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

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

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

Results (primary -2.1%, 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)
- - 0
Regressions ❌
(secondary)
5.8% [5.8%, 5.8%] 1
Improvements ✅
(primary)
-2.1% [-2.1%, -2.1%] 1
Improvements ✅
(secondary)
-3.0% [-4.1%, -2.2%] 3
All ❌✅ (primary) -2.1% [-2.1%, -2.1%] 1

Cycles

Results (primary 2.5%, secondary -3.2%)

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

mean range count
Regressions ❌
(primary)
2.5% [2.5%, 2.5%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.2% [-3.2%, -3.2%] 1
All ❌✅ (primary) 2.5% [2.5%, 2.5%] 1

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 486.164s -> 485.416s (-0.15%)
Artifact size: 387.87 MiB -> 387.92 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 21, 2026
@Kobzol

Kobzol commented Jul 22, 2026

Copy link
Copy Markdown
Member Author

@bors try jobs=dist-x86_64-linux @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 22, 2026
rust-bors Bot pushed a commit that referenced this pull request Jul 22, 2026
Optimize Clippy with PGO


try-job: dist-x86_64-linux
@rust-bors

rust-bors Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 9e8b7aa (9e8b7aa75dfcaaee85081452174dfaf8fb2283aa)
Base parent: b9ee8d8 (b9ee8d8bcb1e4c7905a183a37e6d984c4b9a8468)

@rust-timer

This comment has been minimized.

@Kobzol

Kobzol commented Jul 22, 2026

Copy link
Copy Markdown
Member Author

I forgot to include the Clippy benchmarks 🤦‍♂️

@bors try jobs=dist-x86_64-linux

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 22, 2026
Optimize Clippy with PGO


try-job: dist-x86_64-linux
@Kobzol

Kobzol commented Jul 22, 2026

Copy link
Copy Markdown
Member Author

On https://github.com/It4innovations/hyperqueue, this is locally a 7-8% wall-time win, nice!

@Kobzol

Kobzol commented Jul 22, 2026

Copy link
Copy Markdown
Member Author

Local benchmark for Clippy icounts for syn, serde and Cargo:
image

Nice!

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (9e8b7aa): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

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

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

This perf run didn't have relevant results for this metric.

Cycles

Results (secondary 0.1%)

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

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.6% [2.4%, 2.8%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.8% [-4.8%, -4.8%] 1
All ❌✅ (primary) - - 0

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 486.905s -> 487.72s (0.17%)
Artifact size: 387.85 MiB -> 387.77 MiB (-0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 22, 2026
@rust-bors

rust-bors Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: def8243 (def824372694ad2e8ae59f6d0d7243060a71e843)
Base parent: 1af98b7 (1af98b7cdf86932b76182a387f52f1be6f0c1be0)

@Kobzol

Kobzol commented Jul 22, 2026

Copy link
Copy Markdown
Member Author

@rust-timer build def8243 profiles=Clippy

@rust-timer

This comment has been minimized.

@Kobzol

Kobzol commented Jul 22, 2026

Copy link
Copy Markdown
Member Author

@bors try

Starting a fast try build, which should not build/optimize Clippy.

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 22, 2026
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (def8243): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

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

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

This perf run didn't have relevant results for this metric.

Cycles

This perf run didn't have relevant results for this metric.

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 485.602s -> 486.897s (0.27%)
Artifact size: 387.89 MiB -> 388.56 MiB (0.17%)

@rust-bors

rust-bors Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: f45359a (f45359a5a36c708cbbb13409d5671c016e102c5b)
Base parent: c188565 (c188565812a9b414ddf02f3c7d89e84f1ba53f7d)

@Kobzol

Kobzol commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

@bors try jobs=dist-x86_64-linux @rust-timer queue profiles=Clippy

@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 Jul 23, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 23, 2026
Optimize Clippy with PGO


try-job: dist-x86_64-linux
@rust-bors

rust-bors Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: caf6734 (caf67342a544d6eab7a40ebf0d02e802f62008a4)
Base parent: 390279b (390279b302ca98ae270f434100ae3730531d1246)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (caf6734): comparison URL.

Overall result: ✅ improvements - no action needed

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.

@bors rollup=never rustc-perf
@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)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-4.6% [-16.6%, -0.9%] 79
Improvements ✅
(secondary)
-4.4% [-17.3%, -0.4%] 83
All ❌✅ (primary) -4.6% [-16.6%, -0.9%] 79

Max RSS (memory usage)

Results (primary -1.1%, secondary -2.1%)

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

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.1% [-3.7%, -0.4%] 78
Improvements ✅
(secondary)
-2.1% [-4.1%, -0.7%] 97
All ❌✅ (primary) -1.1% [-3.7%, -0.4%] 78

Cycles

Results (primary -5.3%, secondary -5.5%)

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

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.7% [0.5%, 0.8%] 2
Improvements ✅
(primary)
-5.3% [-23.9%, -0.9%] 83
Improvements ✅
(secondary)
-5.6% [-24.8%, -0.5%] 92
All ❌✅ (primary) -5.3% [-23.9%, -0.9%] 83

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 486.724s -> 487.519s (0.16%)
Artifact size: 387.61 MiB -> 387.59 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants