Skip to content

perf: return early from in_external_macro for root contexts - #161258

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
xmakro:perf/in-external-macro-root-fast-path
Aug 18, 2026
Merged

perf: return early from in_external_macro for root contexts#161258
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
xmakro:perf/in-external-macro-root-fast-path

Conversation

@xmakro

@xmakro xmakro commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

This line was hot when profiling clippy-driver. With this change, clippy instructions reduce for ryu -1.01%, syn -0.21%, regex -0.20%.

r? @petrochenkov

@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 Aug 17, 2026
@petrochenkov

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@rust-bors

rust-bors Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 68846ef has been approved by petrochenkov

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 Aug 18, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 18, 2026
…-fast-path, r=petrochenkov

perf: return early from in_external_macro for root contexts

This line was hot when profiling clippy-driver. With this change, clippy instructions reduce for ryu -1.01%, syn -0.21%, regex -0.20%.

r? @petrochenkov
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 18, 2026
…-fast-path, r=petrochenkov

perf: return early from in_external_macro for root contexts

This line was hot when profiling clippy-driver. With this change, clippy instructions reduce for ryu -1.01%, syn -0.21%, regex -0.20%.

r? @petrochenkov
rust-bors Bot pushed a commit that referenced this pull request Aug 18, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #161024 (resolving cyclic glob vis-max)
 - #161231 (passes: `rustc_scalable_vector` fields are not dead)
 - #161238 (remove scalar size mismatch interpreter error, make it an ICE instead)
 - #160345 (Resolver: add `checked` methods for `Cm(Ref)Cell`)
 - #161129 (Avoid ICE when recovering parenthesized type parameters)
 - #161235 (Compute job time in post-merge-report from the actual GitHub duration)
 - #161239 (Fix `#[repr(transparent)]` wrapper types not working with `Complex<T>`)
 - #161244 (Add regression test for indexing an unsized static without a body)
 - #161257 (Ignore target feature test when LLVM fails to compile minicore)
 - #161258 (perf: return early from in_external_macro for root contexts)
 - #161278 (Add regression test for normalization failure on erased closure in async block)
@Kobzol

Kobzol commented Aug 18, 2026

Copy link
Copy Markdown
Member

@bors try @rust-timer queue profiles=check,clippy

@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 Aug 18, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 18, 2026
… r=<try>

perf: return early from in_external_macro for root contexts
@rust-bors

rust-bors Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 68b3158 (68b31587c5132ee225576f3a475c5b98d7cc62bd)
Base parent: 444dcce (444dcce484c66c8d626806a8556be3b4d3ef381a)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (68b3158): comparison URL.

Overall result: no relevant changes - BENCHMARK(S) FAILED

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

❗ ❗ ❗ ❗ ❗
Warning ⚠️: The following benchmark(s) failed to build:

  • Job failure

❗ ❗ ❗ ❗ ❗

Instruction count

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

Max RSS (memory usage)

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

Cycles

Results (secondary 3.5%)

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

Binary size

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

Bootstrap: 455.347s -> 458.225s (0.63%)
Artifact size: 398.98 MiB -> 398.94 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 18, 2026
@rust-bors
rust-bors Bot merged commit bb0dea0 into rust-lang:main Aug 18, 2026
14 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Aug 18, 2026
rust-bors Bot pushed a commit that referenced this pull request Aug 18, 2026
Rollup merge of #161258 - xmakro:perf/in-external-macro-root-fast-path, r=petrochenkov

perf: return early from in_external_macro for root contexts

This line was hot when profiling clippy-driver. With this change, clippy instructions reduce for ryu -1.01%, syn -0.21%, regex -0.20%.

r? @petrochenkov
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Aug 19, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#161024 (resolving cyclic glob vis-max)
 - rust-lang/rust#161231 (passes: `rustc_scalable_vector` fields are not dead)
 - rust-lang/rust#161238 (remove scalar size mismatch interpreter error, make it an ICE instead)
 - rust-lang/rust#160345 (Resolver: add `checked` methods for `Cm(Ref)Cell`)
 - rust-lang/rust#161129 (Avoid ICE when recovering parenthesized type parameters)
 - rust-lang/rust#161235 (Compute job time in post-merge-report from the actual GitHub duration)
 - rust-lang/rust#161239 (Fix `#[repr(transparent)]` wrapper types not working with `Complex<T>`)
 - rust-lang/rust#161244 (Add regression test for indexing an unsized static without a body)
 - rust-lang/rust#161257 (Ignore target feature test when LLVM fails to compile minicore)
 - rust-lang/rust#161258 (perf: return early from in_external_macro for root contexts)
 - rust-lang/rust#161278 (Add regression test for normalization failure on erased closure in async block)
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.

5 participants