Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootstrap: Memoize the LLVM rebuild hash to avoid very slow x check #118352

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

Zalathar
Copy link
Contributor

@Zalathar Zalathar commented Nov 27, 2023

Recently I've encountered a massive regression in the performance of re-running x check after making no changes.

It used to take around 2 seconds, and now it takes 20-30 seconds. That's quite a hassle when r-a runs it every time I save.

After some poking around, what I've found is that each individual call to generate_smart_stamp_hash takes only a modestly long time (around 0.5 sec), but it gets called dozens of times during x check, and that seems to be what's adding up to 20-30 seconds.


https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Massive.20regression.20in.20no-op.20.60x.20check.60

cc @onur-ozkan

@rustbot
Copy link
Collaborator

rustbot commented Nov 27, 2023

r? @albertlarsan68

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Nov 27, 2023
@rustbot
Copy link
Collaborator

rustbot commented Nov 27, 2023

This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp.

@Zalathar
Copy link
Contributor Author

This is an alternative to #118351.

It's very much intended as a quick-fix to solve the immediate issue of no-op check builds taking way too long (~30 sec instead of ~2 sec).

I'm open to fixing this in better ways, but I think it's worth at least working around this as soon as possible, so that people's dev environments are functional again.

(I assume this is one of those issues that stems from git being way faster on Linux than on other platforms.)

@onur-ozkan
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Nov 27, 2023

📌 Commit 4f1cf0b has been approved by onur-ozkan

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 27, 2023
@bors
Copy link
Contributor

bors commented Nov 27, 2023

⌛ Testing commit 4f1cf0b with merge b29a1e0...

@bors
Copy link
Contributor

bors commented Nov 27, 2023

☀️ Test successful - checks-actions
Approved by: onur-ozkan
Pushing b29a1e0 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 27, 2023
@bors bors merged commit b29a1e0 into rust-lang:master Nov 27, 2023
12 checks passed
@rustbot rustbot added this to the 1.76.0 milestone Nov 27, 2023
@Zalathar Zalathar deleted the llvm-hash branch November 27, 2023 23:56
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b29a1e0): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

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

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 674.949s -> 675.168s (0.03%)
Artifact size: 313.35 MiB -> 313.39 MiB (0.01%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

6 participants