Skip to content

Conversation

@folkertdev
Copy link
Contributor

Could be a fix for a potential performance regression reported here #144529 (comment). Apparently the regression later disappeared. Nevertheless, this seems like a decent refactor.

r? @JonathanBrouwer (vaguely attribute-related, maybe there are other optimizations to that PR that we're missing)

@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 Nov 6, 2025
@workingjubilee
Copy link
Member

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Nov 6, 2025
re-use `self.get_all_attrs` result for pass indirectly attribute
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 6, 2025
@JonathanBrouwer
Copy link
Contributor

JonathanBrouwer commented Nov 6, 2025

get_all_attrs is pretty fast so I can't really imagine this being a performance improvement, but I think this improves the code anyways so lets merge it
@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Nov 6, 2025

📌 Commit 1a9cc78 has been approved by JonathanBrouwer

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 6, 2025
@folkertdev
Copy link
Contributor Author

Does anything else in #144529 jump out to you?

@JonathanBrouwer
Copy link
Contributor

Hmmm we do need to call pass_indirectly_in_non_rustic_abis on every argument, which does need to look through the flags, but I can't see that being significant and I can't see why it would specifically affect this benchmark.

I just took a look at the implementation of get_all_attrs, and it's just a btreemap lookup so it should not be that slow. I (and humans in general) are not good at predicting performance tho so lets let the numbers speak. We call get_all_attrs a ton of times throughout the compiler though so if that's slow we are leaving a lot of performance on the table.

Alternatively it could've just been noise, since the benchmark did just bounce back. I think it being noise is the most likely answer.

@rust-bors
Copy link

rust-bors bot commented Nov 6, 2025

☀️ Try build successful (CI)
Build commit: 1869732 (18697328f3073a12811e91ab3af2d58b27d9689f, parent: c90bcb9571b7aab0d8beaa2ce8a998ffaf079d38)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1869732): comparison URL.

Overall result: no relevant changes - no action needed

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.

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

Instruction count

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

Max RSS (memory usage)

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

Cycles

Results (primary -2.4%, secondary -3.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)
-3.4% [-3.4%, -3.4%] 1
All ❌✅ (primary) -2.4% [-2.4%, -2.4%] 1

Binary size

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

Bootstrap: 475.185s -> 475.633s (0.09%)
Artifact size: 390.81 MiB -> 390.80 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 7, 2025
@JonathanBrouwer
Copy link
Contributor

@bors rollup

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Nov 7, 2025
…ttrs, r=JonathanBrouwer

re-use `self.get_all_attrs` result for pass indirectly attribute

Could be a fix for a potential performance regression reported here rust-lang#144529 (comment). Apparently the regression later disappeared. Nevertheless, this seems like a decent refactor.

r? `@JonathanBrouwer` (vaguely attribute-related, maybe there are other optimizations to that PR that we're missing)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

6 participants