Skip to content

Rollup of 3 perf-sensitive pull requests - #164911

Closed
JonathanBrouwer wants to merge 10 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-I91jxgx
Closed

JonathanBrouwer wants to merge 10 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-I91jxgx

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

Successful merges:

Failed merges:

r? @ghost

Create a similar rollup

joshtriplett and others added 10 commits October 5, 2026 14:46
This avoids needing the overhead of a call before discovering that the
`Cow` is already owned.
These show up in hot paths, and inlining should allow optimizing them.
These are simple wrappers but nonetheless don't get inlined and show up
in hot paths.
These are simple wrappers.
…Simulacrum

Add various `#[inline]` annotations for simple functions on hot paths that don't get inlined

All of these are simple, likely to be optimizable once inlined into their caller, and found on hot paths in profiles (I used `clap_derive` for the profiling) as non-inlined functions.
…=hanna-kruppe

Don't emit allow attributes in try/contract desugaring
…rouwer,nnethercote

create fast path for attributes created in builtin macro expansions

Emitting attributes in rustc_builtin_macros involves creating an `ast::Attribute` and token trees, just to parse that into a parsed attribute almost immediately. This PR sidesteps that by creating a new `ast::Attribute` variant that does not do this. I've taken care to only do this for the derive and test macros, so that they never re-enter the parser.

This results in some moderate performance gains. It'll also take away almost all of the regressions in rust-lang#164217 (comment) (see rust-lang#164281 (comment) for a perf run of this and that PR stacked)

r? @nnethercote
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Oct 25, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Oct 25, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors r+ p=5 force

Trying commonly failed jobs
@bors try jobs=dist-various-1,test-various,test-x86_64-gnu-aux,test-x86_64-msvc-1,test-aarch64-apple-1,test-aarch64-apple-2,test-x86_64-mingw-1,test-i686-msvc,test-armhf-gnu,test-x86_64-gnu-llvm-22-3

@rust-bors

rust-bors Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 2690222 has been approved by JonathanBrouwer

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 Oct 25, 2026
@JonathanBrouwer JonathanBrouwer changed the title Rollup of 3 pull requests Rollup of 4 perf-sensitive pull requests Oct 25, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 25, 2026
Rollup of 3 pull requests


try-job: dist-various-1
try-job: test-various
try-job: test-x86_64-gnu-aux
try-job: test-x86_64-msvc-1
try-job: test-aarch64-apple-1
try-job: test-aarch64-apple-2
try-job: test-x86_64-mingw-1
try-job: test-i686-msvc
try-job: test-armhf-gnu
try-job: test-x86_64-gnu-llvm-22-3
@JonathanBrouwer JonathanBrouwer changed the title Rollup of 4 perf-sensitive pull requests Rollup of 3 perf-sensitive pull requests Oct 25, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 25, 2026
…uwer

Rollup of 3 perf-sensitive pull requests

Successful merges:

 - #163845 (Add various `#[inline]` annotations for simple functions on hot paths that don't get inlined)
 - #164122 (Don't emit allow attributes in try/contract desugaring)
 - #164260 (create fast path for attributes created in builtin macro expansions)

Failed merges:

 - #164790 (Split `LintLevelsBuilder::add` into `add_ast` and `add_hir`)
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job dist-apple-various failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] aho_corasick test:false 3.691
   Compiling regex-automata v0.4.14
error: linking with `cc` failed: exit status: 1
  |
  = note:  "cc" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/bootstrap-tools/release/build/libc/d8567d04e33e0bc0/out/rustceMfNHc/symbols.o" "<3 object files omitted>" "<sysroot>/lib/rustlib/aarch64-apple-darwin/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,libcfg_if-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,liblibc-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-lSystem" "-lc" "-lm" "-arch" "arm64" "-mmacosx-version-min=11.0.0" "-o" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/bootstrap-tools/release/build/libc/d8567d04e33e0bc0/out/build_script_build" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: clang: error: unable to execute command: Segmentation fault: 11
          clang: error: linker command failed due to signal (use -v to see invocation)
          Apple clang version 17.0.0 (clang-1700.6.3.2)
          Target: arm64-apple-darwin24.6.0
          Thread model: posix
          InstalledDir: /Applications/Xcode_26.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
          clang: note: diagnostic msg: 
          ********************
          
          PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
          Linker snapshot containing input(s) and associated run script(s) are located at:
          clang: note: diagnostic msg: /var/folders/nj/vtw8zd2j31d1gdrtntc5y4600000gn/T/linker-crash-e55b48
          clang: note: diagnostic msg: 
          
          ********************
          

[RUSTC-TIMING] build_script_build test:false 2.169

@rust-bors rust-bors Bot 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 Oct 25, 2026
@rust-bors

rust-bors Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 5c46d6f failed: CI. Failed job:

@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors retry
@bors try jobs=dist-apple-various

@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 Oct 25, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 25, 2026
Rollup of 3 perf-sensitive pull requests


try-job: dist-apple-various
@rust-bors rust-bors Bot 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 25, 2026
@rust-bors

rust-bors Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved due to being closed.

@rust-bors

rust-bors Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 828f835 (828f8351224b0a1f171e19da77ba8c540c37f90b)
Base parent: dc44e7f (dc44e7f2c436b6041742e138b9c2176f093196d5)

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

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library 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