Skip to content

Tweak bounds check in DepNodeColorMap.get - #151540

Closed
Zoxc wants to merge 1 commit into
rust-lang:mainfrom
Zoxc:color-get-opt
Closed

Tweak bounds check in DepNodeColorMap.get#151540
Zoxc wants to merge 1 commit into
rust-lang:mainfrom
Zoxc:color-get-opt

Conversation

@Zoxc

@Zoxc Zoxc commented Jan 23, 2026

Copy link
Copy Markdown
Contributor

This aligns the outer bounds check for a green color in DepNodeColorMap.get with the bounds check in DepNodeIndex::from_u32, allowing the latter to be optimized out.

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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 Jan 23, 2026
@rustbot

rustbot commented Jan 23, 2026

Copy link
Copy Markdown
Collaborator

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

@jieyouxu jieyouxu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@jieyouxu

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Jan 23, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 58dd2e5 has been approved by jieyouxu

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Jan 23, 2026
@Kobzol

Kobzol commented Jan 23, 2026

Copy link
Copy Markdown
Member

@bors try @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 Jan 23, 2026
rust-bors Bot pushed a commit that referenced this pull request Jan 23, 2026
Tweak bounds check in `DepNodeColorMap.get`
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jan 23, 2026
Tweak bounds check in `DepNodeColorMap.get`

This aligns the outer bounds check for a green color in `DepNodeColorMap.get` with the bounds check in `DepNodeIndex::from_u32`, allowing the latter to be optimized out.
rust-bors Bot pushed a commit that referenced this pull request Jan 23, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #149848 (Use allocator_shim_contents in allocator_shim_symbols)
 - #150556 (Add Tier 3 Thumb-mode targets for Armv7-A, Armv7-R and Armv8-R)
 - #151259 (Fix is_ascii performance regression on AVX-512 CPUs when compiling with -C target-cpu=native)
 - #151482 (Add "Skip to main content" link for keyboard navigation in rustdoc)
 - #151505 (Various refactors to the proc_macro bridge)
 - #151517 (Enable reproducible binary builds with debuginfo on Linux)
 - #151540 (Tweak bounds check in `DepNodeColorMap.get`)

r? @ghost
@rust-bors

rust-bors Bot commented Jan 23, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 49b2c82 (49b2c82bcb646f44fadaea3c69874dcdc68f1d0a, parent: 5944b12bd4cca78d0c32aa67b501af3e1aefd1a9)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (49b2c82): comparison URL.

Overall result: ❌ regressions - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@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.2% [0.2%, 3.1%] 113
Regressions ❌
(secondary)
1.1% [0.2%, 2.5%] 65
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.2% [0.2%, 3.1%] 113

Max RSS (memory usage)

Results (secondary 4.7%)

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)
4.7% [2.6%, 6.8%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results (primary -2.3%)

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)
-2.3% [-2.6%, -2.0%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.3% [-2.6%, -2.0%] 2

Binary size

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

Bootstrap: 474.479s -> 470.042s (-0.94%)
Artifact size: 383.49 MiB -> 383.52 MiB (0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jan 23, 2026
@Kobzol

Kobzol commented Jan 23, 2026

Copy link
Copy Markdown
Member

Looks like it is a regression, rather than a win. Changes to the query system should ideally always be benchmarked first.

@bors r-

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 23, 2026
@rust-bors

rust-bors Bot commented Jan 23, 2026

Copy link
Copy Markdown
Contributor

Commit 58dd2e5 has been unapproved.

@rust-bors

This comment has been minimized.

@rustbot

rustbot commented Mar 24, 2026

Copy link
Copy Markdown
Collaborator

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.

@Zoxc

Zoxc commented Mar 24, 2026

Copy link
Copy Markdown
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Mar 24, 2026
Tweak bounds check in `DepNodeColorMap.get`
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 24, 2026
@rust-bors

rust-bors Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: d0926c0 (d0926c01fa83d2ebd337c7a8ea80ddde4df40d0b, parent: f66622c7eca7fc48ccc4dac848ff911b09a4d566)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (d0926c0): comparison URL.

Overall result: ❌ regressions - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@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.1% [0.2%, 2.6%] 108
Regressions ❌
(secondary)
0.9% [0.2%, 2.2%] 63
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.1% [0.2%, 2.6%] 108

Max RSS (memory usage)

Results (primary 2.3%, secondary 4.7%)

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

mean range count
Regressions ❌
(primary)
2.3% [2.3%, 2.3%] 1
Regressions ❌
(secondary)
4.7% [2.6%, 6.7%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.3% [2.3%, 2.3%] 1

Cycles

Results (secondary -2.2%)

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)
- - 0
Improvements ✅
(secondary)
-2.2% [-2.2%, -2.2%] 1
All ❌✅ (primary) - - 0

Binary size

Results (primary 0.1%, 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.1% [0.0%, 0.1%] 47
Regressions ❌
(secondary)
0.1% [0.0%, 0.1%] 22
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.0%, 0.1%] 47

Bootstrap: 484.979s -> 487.478s (0.52%)
Artifact size: 394.94 MiB -> 395.00 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 24, 2026
@Zoxc Zoxc closed this Aug 3, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) perf-regression Performance regression. 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