Skip to content

cache last file returned by lookup_debug_loc in the llvm backend - #166258

Open
susitsm wants to merge 1 commit into
rust-lang:mainfrom
susitsm:cache-last-debug-loc-file
Open

susitsm wants to merge 1 commit into
rust-lang:mainfrom
susitsm:cache-last-debug-loc-file

Conversation

@susitsm

@susitsm susitsm commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

@rustbot

rustbot commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in compiler/rustc_codegen_llvm/src/debuginfo

cc @Walnut356

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. 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 Nov 20, 2026
@rustbot

rustbot commented Nov 20, 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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler, debuginfo
  • compiler, debuginfo expanded to 79 candidates
  • Random selection from 20 candidates

@susitsm
susitsm force-pushed the cache-last-debug-loc-file branch from f845c0c to ddb99a6 Compare November 20, 2026 13:42
@jieyouxu

Copy link
Copy Markdown
Member

Will be fighting CI this weekend.
@rustbot reroll

@rustbot rustbot assigned TaKO8Ki and unassigned jieyouxu Nov 21, 2026
@hanna-kruppe

Copy link
Copy Markdown
Contributor

@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 Nov 21, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Nov 21, 2026
cache last file returned by lookup_debug_loc in the llvm backend
@susitsm
susitsm force-pushed the cache-last-debug-loc-file branch from ddb99a6 to 1da8284 Compare November 21, 2026 09:09
@rust-bors

rust-bors Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 7193fa7 (7193fa7e18ccaa9b3f6dd8a723cb35647c67e565)
Base parent: c7d5ba5 (c7d5ba59d8e11ee2e2204b173458eec4cb41c973)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown

Finished benchmarking commit (7193fa7): comparison URL.

Overall result: ✅ improvements - no action needed

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

@bors rollup=iffy 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)
-0.3% [-0.3%, -0.2%] 6
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.3% [-0.3%, -0.2%] 6

Max RSS (memory usage)

Results (secondary 0.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)
0.7% [0.5%, 1.1%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results (secondary 2.6%)

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

Binary size

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

Bootstrap: 460.905s -> 493.975s (7.18%)
Artifact size: 405.35 MiB -> 405.43 MiB (0.02%)

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

susitsm commented Nov 23, 2026

Copy link
Copy Markdown
Member Author

I was hoping for more visible results, my local tests ran on cargo. Which also shows up here. It has more green when show non-relevant results is enabled. I am ok with both merging and closing this.

@rust-bors

This comment has been minimized.

@susitsm
susitsm force-pushed the cache-last-debug-loc-file branch from 1da8284 to 4ca7b78 Compare November 24, 2026 07:10
@rustbot

rustbot commented Nov 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.

@Kobzol

Kobzol commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

I think that the wins are genuine (albeit small). I was also looking into this recently and this place seems quite hot. I wonder if we could generalize this though, and maybe keep a small buffer (e.g. 5 last files) that we would scan through linearly.

@hanna-kruppe

Copy link
Copy Markdown
Contributor

Let’s give this another shot since #166140 is merged now and plausibly interacts with this: reusing more DISubprograms should mean fewer location lookups, but may also make a single-entry cache more effective since inlined callees are usually from other files and, so skipping those lookups may reduce thrashing. @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 Nov 24, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 24, 2026
cache last file returned by lookup_debug_loc in the llvm backend
@rust-bors

This comment has been minimized.

@rust-bors

rust-bors Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 77abf1a (77abf1a1ce5db7318ebbe6296f8d4c2342afe047)
Base parent: 058c701 (058c701055c4b6f60f622d616afc0349911c38c3)

@rust-timer

This comment has been minimized.

@susitsm

susitsm commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

I've also opened #166457 as a possible alternative. Could I get a perf run please?

@rust-timer

Copy link
Copy Markdown

Finished benchmarking commit (77abf1a): comparison URL.

Overall result: ✅ improvements - 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

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)
-0.3% [-0.3%, -0.3%] 1
Improvements ✅
(secondary)
-0.3% [-0.5%, -0.2%] 4
All ❌✅ (primary) -0.3% [-0.3%, -0.3%] 1

Max RSS (memory usage)

Results (primary 2.4%, secondary 2.0%)

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

mean range count
Regressions ❌
(primary)
2.4% [1.6%, 3.4%] 4
Regressions ❌
(secondary)
2.4% [1.2%, 3.7%] 11
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.3% [-2.3%, -2.3%] 1
All ❌✅ (primary) 2.4% [1.6%, 3.4%] 4

Cycles

Results (primary -2.4%)

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

Binary size

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

Bootstrap: 462.461s -> 461.616s (-0.18%)
Artifact size: 405.65 MiB -> 405.67 MiB (0.00%)

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

This branch has not been deployed

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

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. 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