Skip to content

expand: Micro-optimize prelude injection #144587

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

Merged
merged 1 commit into from
Jul 29, 2025
Merged

Conversation

petrochenkov
Copy link
Contributor

Use splice to avoid shifting the other items twice.
Put extern crate std; first so it's already resolved when we resolve ::std::prelude::rust_20XX.

Use `splice` to avoid shifting the other items twice.
Put `extern crate std;` first so it's already resolved when we resolve `::std::prelude::rust_20XX`.
@rustbot
Copy link
Collaborator

rustbot commented Jul 28, 2025

r? @lcnr

rustbot has assigned @lcnr.
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

@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 Jul 28, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 28, 2025

Changes to the code generated for builtin derived traits.

cc @nnethercote

@petrochenkov
Copy link
Contributor Author

It's probably within the noise, but let's try.
@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Jul 28, 2025
expand: Micro-optimize prelude injection
@rust-bors
Copy link

rust-bors bot commented Jul 28, 2025

⌛ Trying commit c56f49d with merge 50660dc

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 Jul 28, 2025
@rust-bors
Copy link

rust-bors bot commented Jul 28, 2025

☀️ Try build successful (CI)
Build commit: 50660dc (50660dca656b745763302a57e270bfff7163a885, parent: 65b6cdb6a6d33987b9d642a4882283c71fbe3957)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (50660dc): comparison URL.

Overall result: ❌✅ regressions and improvements - 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.0% [0.0%, 0.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.8% [-1.0%, -0.0%] 7
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 1.3%, secondary 2.3%)

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

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

Cycles

Results (primary -2.2%, secondary -1.1%)

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

Binary size

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

Bootstrap: 468.035s -> 467.096s (-0.20%)
Artifact size: 376.82 MiB -> 376.87 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 28, 2025
@petrochenkov petrochenkov 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-review Status: Awaiting review from the assignee but also interested parties. labels Jul 28, 2025
@nnethercote
Copy link
Contributor

Why not, it's a tiny bit cleaner, and I like the pp output more.

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 29, 2025

📌 Commit c56f49d has been approved by nnethercote

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 29, 2025
@bors
Copy link
Collaborator

bors commented Jul 29, 2025

⌛ Testing commit c56f49d with merge 0410836...

bors added a commit that referenced this pull request Jul 29, 2025
expand: Micro-optimize prelude injection

Use `splice` to avoid shifting the other items twice.
Put `extern crate std;` first so it's already resolved when we resolve `::std::prelude::rust_20XX`.
@bors
Copy link
Collaborator

bors commented Jul 29, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 29, 2025
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:01:16 --:--:--     0
curl: (35) schannel: next InitializeSecurityContext failed: CRYPT_E_REVOCATION_OFFLINE (0x80092013) - The revocation function was unable to check revocation because the revocation server was offline.
##[error]Process completed with exit code 35.
Post job cleanup.
[command]"C:\Program Files\Git\bin\git.exe" version
git version 2.50.1.windows.1
Copying 'C:\Users\runneradmin\.gitconfig' to 'D:\a\_temp\beb53847-a574-402d-9380-f03b5d4479b3\.gitconfig'
Temporarily overriding HOME='D:\a\_temp\beb53847-a574-402d-9380-f03b5d4479b3' before making global git config changes

@petrochenkov
Copy link
Contributor Author

I want to check the cachegrind diff first, the perf results are a bit weird.
@rustbot author

@rustbot rustbot 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-review Status: Awaiting review from the assignee but also interested parties. labels Jul 29, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 29, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@lqd
Copy link
Member

lqd commented Jul 29, 2025

I want to check the cachegrind diff first, the perf results are a bit weird.

match-stress was noisy very recently

@petrochenkov
Copy link
Contributor Author

r? @nnethercote
@bors r=nnethercote rollup

@bors
Copy link
Collaborator

bors commented Jul 29, 2025

💡 This pull request was already approved, no need to approve it again.

  • This pull request previously failed. You should add more commits to fix the bug, or use retry to trigger a build again.
  • There's another pull request that is currently being tested, blocking this pull request: Rollup of 13 pull requests #144633

@bors
Copy link
Collaborator

bors commented Jul 29, 2025

📌 Commit c56f49d has been approved by nnethercote

It is now in the queue for this repository.

@rustbot
Copy link
Collaborator

rustbot commented Jul 29, 2025

nnethercote is not on the review rotation at the moment.
They may take a while to respond.

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 29, 2025
bors added a commit that referenced this pull request Jul 29, 2025
Rollup of 6 pull requests

Successful merges:

 - #144560 (coverage: Treat `#[automatically_derived]` as `#[coverage(off)]`)
 - #144566 (Simplify `align_of_val::<[T]>(…)` → `align_of::<T>()`)
 - #144587 (expand: Micro-optimize prelude injection)
 - #144589 (Account for `.yield` in illegal postfix operator message)
 - #144615 (Make resolve_fn_signature responsible for its own rib.)
 - #144634 (Fix typo in `DropGuard` doc)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 3d5e2fa into rust-lang:master Jul 29, 2025
11 of 12 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 29, 2025
rust-timer added a commit that referenced this pull request Jul 29, 2025
Rollup merge of #144587 - petrochenkov:optstdprel, r=nnethercote

expand: Micro-optimize prelude injection

Use `splice` to avoid shifting the other items twice.
Put `extern crate std;` first so it's already resolved when we resolve `::std::prelude::rust_20XX`.
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.

8 participants