Skip to content

Conversation

@cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Aug 2, 2025

Typeck relies on attributes to modify its own behaviour. This is a problem, as this means that typeck(some function) may depend on the span and doc-comments of many other functions.

This PR attempts to reduce such accesses to attributes. This yields to a sizeable perf improvement: #144841 (comment)

Fixes #124352

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 2, 2025
@cjgillot
Copy link
Contributor Author

cjgillot commented Aug 2, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Aug 2, 2025
Access less HIR attributes from typeck
@rust-bors
Copy link

rust-bors bot commented Aug 2, 2025

⌛ Trying commit d414182 with merge 23dde9b

To cancel the try build, run the command @bors try cancel.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 2, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Aug 2, 2025

💔 Test failed (CI). Failed jobs:

@rust-log-analyzer

This comment has been minimized.

@cjgillot
Copy link
Contributor Author

cjgillot commented Aug 3, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Aug 3, 2025
Access less HIR attributes from typeck
@rust-bors
Copy link

rust-bors bot commented Aug 3, 2025

⌛ Trying commit bf644e9 with merge 038c022

To cancel the try build, run the command @bors try cancel.

@rust-bors
Copy link

rust-bors bot commented Aug 3, 2025

☀️ Try build successful (CI)
Build commit: 038c022 (038c02289a15c742f6a0d54925c12902ffe09884, parent: f34ba774c78ea32b7c40598b8ad23e75cdac42a6)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (038c022): comparison URL.

Overall result: ❌ regressions - 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

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

Max RSS (memory usage)

Results (primary 1.5%, secondary 4.3%)

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

mean range count
Regressions ❌
(primary)
1.5% [1.4%, 1.5%] 2
Regressions ❌
(secondary)
4.3% [2.0%, 7.4%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.5% [1.4%, 1.5%] 2

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: 467.629s -> 467.286s (-0.07%)
Artifact size: 376.97 MiB -> 376.99 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 4, 2025
@cjgillot
Copy link
Contributor Author

cjgillot commented Aug 5, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Aug 5, 2025

❌ Encountered an error while executing command

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 5, 2025
@cjgillot
Copy link
Contributor Author

cjgillot commented Aug 5, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Aug 5, 2025
Access less HIR attributes from typeck
@rustbot
Copy link
Collaborator

rustbot commented Aug 5, 2025

This PR changes a file inside tests/crashes. If a crash was fixed, please move into the corresponding ui subdir and add 'Fixes #' to the PR description to autoclose the issue upon merge.

@cjgillot
Copy link
Contributor Author

r? compiler

@rustbot rustbot assigned davidtwco and unassigned SparrowLii Aug 21, 2025
Copy link
Member

@davidtwco davidtwco left a comment

Choose a reason for hiding this comment

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

LGTM pending one review comment

@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 26, 2025

📌 Commit 6b7f8fb has been approved by davidtwco

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 Aug 26, 2025
@bors
Copy link
Collaborator

bors commented Aug 27, 2025

⌛ Testing commit 6b7f8fb with merge 269d5b5...

@bors
Copy link
Collaborator

bors commented Aug 27, 2025

☀️ Test successful - checks-actions
Approved by: davidtwco
Pushing 269d5b5 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 27, 2025
@bors bors merged commit 269d5b5 into rust-lang:master Aug 27, 2025
12 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 27, 2025
@github-actions
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 176d8db (parent) -> 269d5b5 (this PR)

Test differences

Show 12 test diffs

Stage 1

  • [crashes] tests/crashes/124352.rs: pass -> [missing] (J0)
  • [ui] tests/ui/attributes/malformed-never-type-options.rs: [missing] -> pass (J0)

Stage 2

  • [crashes] tests/crashes/124352.rs: pass -> [missing] (J1)
  • [ui] tests/ui/attributes/malformed-never-type-options.rs: [missing] -> pass (J2)

Additionally, 8 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 269d5b56bcfdf2be82213e72ef9a2e4c592a8c6b --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. pr-check-1: 1723.9s -> 1407.0s (-18.4%)
  2. dist-apple-various: 4532.6s -> 5205.0s (14.8%)
  3. dist-x86_64-apple: 6948.0s -> 7816.0s (12.5%)
  4. dist-aarch64-msvc: 5667.1s -> 6354.8s (12.1%)
  5. aarch64-apple: 5761.7s -> 5139.6s (-10.8%)
  6. i686-gnu-2: 5689.1s -> 6221.7s (9.4%)
  7. x86_64-gnu-aux: 6347.9s -> 6755.3s (6.4%)
  8. aarch64-msvc-1: 6397.1s -> 6773.0s (5.9%)
  9. aarch64-gnu-llvm-19-1: 3585.8s -> 3780.8s (5.4%)
  10. x86_64-rust-for-linux: 3032.7s -> 2868.8s (-5.4%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Aug 27, 2025
Access less HIR attributes from typeck

Typeck relies on attributes to modify its own behaviour. This is a problem, as this means that `typeck(some function)` may depend on the span and doc-comments of many other functions.

This PR attempts to reduce such accesses to attributes. This yields to a sizeable perf improvement: rust-lang/rust#144841 (comment)

Fixes rust-lang/rust#124352
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (269d5b5): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

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.3% [0.2%, 0.4%] 4
Regressions ❌
(secondary)
2.8% [2.6%, 3.0%] 6
Improvements ✅
(primary)
-1.7% [-7.0%, -0.2%] 17
Improvements ✅
(secondary)
-0.4% [-0.6%, -0.2%] 15
All ❌✅ (primary) -1.3% [-7.0%, 0.4%] 21

Max RSS (memory usage)

Results (primary -0.1%, secondary 4.2%)

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

mean range count
Regressions ❌
(primary)
1.5% [1.5%, 1.5%] 2
Regressions ❌
(secondary)
4.2% [4.2%, 4.2%] 1
Improvements ✅
(primary)
-1.2% [-1.3%, -1.1%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.1% [-1.3%, 1.5%] 5

Cycles

Results (primary -4.1%, secondary 1.0%)

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.3% [4.3%, 4.3%] 1
Improvements ✅
(primary)
-4.1% [-5.7%, -2.3%] 5
Improvements ✅
(secondary)
-2.3% [-2.3%, -2.3%] 1
All ❌✅ (primary) -4.1% [-5.7%, -2.3%] 5

Binary size

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

Bootstrap: 467.709s -> 466.752s (-0.20%)
Artifact size: 391.16 MiB -> 391.24 MiB (0.02%)

@rustbot rustbot added the perf-regression Performance regression. label Aug 27, 2025
@cjgillot cjgillot deleted the typeck-no-attrs branch August 27, 2025 11:12
github-actions bot pushed a commit to rust-lang/compiler-builtins that referenced this pull request Aug 28, 2025
Access less HIR attributes from typeck

Typeck relies on attributes to modify its own behaviour. This is a problem, as this means that `typeck(some function)` may depend on the span and doc-comments of many other functions.

This PR attempts to reduce such accesses to attributes. This yields to a sizeable perf improvement: rust-lang/rust#144841 (comment)

Fixes rust-lang/rust#124352
@Kobzol
Copy link
Member

Kobzol commented Sep 2, 2025

More improvements than regressions, and a very nice incremental win on nalgebra.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Sep 2, 2025
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Sep 8, 2025
Access less HIR attributes from typeck

Typeck relies on attributes to modify its own behaviour. This is a problem, as this means that `typeck(some function)` may depend on the span and doc-comments of many other functions.

This PR attempts to reduce such accesses to attributes. This yields to a sizeable perf improvement: rust-lang/rust#144841 (comment)

Fixes rust-lang/rust#124352
github-actions bot pushed a commit to rust-lang/rust-analyzer that referenced this pull request Sep 25, 2025
Access less HIR attributes from typeck

Typeck relies on attributes to modify its own behaviour. This is a problem, as this means that `typeck(some function)` may depend on the span and doc-comments of many other functions.

This PR attempts to reduce such accesses to attributes. This yields to a sizeable perf improvement: rust-lang/rust#144841 (comment)

Fixes rust-lang/rust#124352
rust-cloud-vms bot pushed a commit to makai410/rustc_public that referenced this pull request Oct 12, 2025
Access less HIR attributes from typeck

Typeck relies on attributes to modify its own behaviour. This is a problem, as this means that `typeck(some function)` may depend on the span and doc-comments of many other functions.

This PR attempts to reduce such accesses to attributes. This yields to a sizeable perf improvement: rust-lang/rust#144841 (comment)

Fixes rust-lang/rust#124352
Kobzol pushed a commit to Kobzol/stdarch that referenced this pull request Nov 2, 2025
Access less HIR attributes from typeck

Typeck relies on attributes to modify its own behaviour. This is a problem, as this means that `typeck(some function)` may depend on the span and doc-comments of many other functions.

This PR attempts to reduce such accesses to attributes. This yields to a sizeable perf improvement: rust-lang/rust#144841 (comment)

Fixes rust-lang/rust#124352
makai410 pushed a commit to makai410/rust that referenced this pull request Nov 8, 2025
Access less HIR attributes from typeck

Typeck relies on attributes to modify its own behaviour. This is a problem, as this means that `typeck(some function)` may depend on the span and doc-comments of many other functions.

This PR attempts to reduce such accesses to attributes. This yields to a sizeable perf improvement: rust-lang#144841 (comment)

Fixes rust-lang#124352
makai410 pushed a commit to makai410/rust that referenced this pull request Nov 10, 2025
Access less HIR attributes from typeck

Typeck relies on attributes to modify its own behaviour. This is a problem, as this means that `typeck(some function)` may depend on the span and doc-comments of many other functions.

This PR attempts to reduce such accesses to attributes. This yields to a sizeable perf improvement: rust-lang#144841 (comment)

Fixes rust-lang#124352
makai410 pushed a commit to makai410/rustc_public that referenced this pull request Nov 16, 2025
Access less HIR attributes from typeck

Typeck relies on attributes to modify its own behaviour. This is a problem, as this means that `typeck(some function)` may depend on the span and doc-comments of many other functions.

This PR attempts to reduce such accesses to attributes. This yields to a sizeable perf improvement: rust-lang/rust#144841 (comment)

Fixes rust-lang/rust#124352
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. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. 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.

ICE: None in rustc_hir_typeck due to malformed attribute

8 participants