Skip to content

perf: reduce matching_root_macro_call usage (23b -> 22.24b)#16756

Merged
Jarcho merged 1 commit intorust-lang:masterfrom
blyxyas:perf-matching_root_macro_call
Mar 24, 2026
Merged

perf: reduce matching_root_macro_call usage (23b -> 22.24b)#16756
Jarcho merged 1 commit intorust-lang:masterfrom
blyxyas:perf-matching_root_macro_call

Conversation

@blyxyas
Copy link
Copy Markdown
Member

@blyxyas blyxyas commented Mar 23, 2026

matching_root_macro_call was taking up lots of instructions. This PR reduces its usage and thus, the number of instructions.

Profiled in wasmi. 23,010,846,019 icount -> 22,245,910,522 icount -3.324% performance improvement!

3 Lints were affected:
- repeat_vec_with_capacity: 783,874,512 -> 24,488,225
- string_patterns: Not measured in benchmark.
- filter_map: Weirdly went from 22,000,078 to 22,017,509. But this doesn't make sense so it's completely anecdotal. (In no world would changing a function call with a boolean check make anything more expensive.

changelog:[repeat_vec_with_capacity]: Optimize by 96.876%

`matching_root_macro_call` was taking up lots of instructions.
This PR reduces its usage and thus, the number of instructions.

Profiled in `wasmi`. 23,010,846,019 icount -> 22,245,910,522 icount
**-3.324%** performance improvement!

3 Lints were affected:
    - `repeat_vec_with_capacity`: 783,874,512 -> 24,488,225
    - `string_patterns`: Not measured in benchmark.
    - `filter_map`: Weirdly went from 22,000,078 to 22,017,509. But this
doesn't make sense so it's completely anecdotal. (In no world would changing
a function call with a boolean check make *anything* more expensive.

changelog:[`repeat_vec_with_capacity`]: Optimize by 96.876%
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Mar 23, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 23, 2026

r? @llogiq

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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: 7 candidates
  • 7 candidates expanded to 7 candidates
  • Random selection from Jarcho, dswij, llogiq, samueltardieu

@blyxyas blyxyas added the G-performance-project Goal: For issues and PRs related to the Clippy Performance Project label Mar 23, 2026
@blyxyas blyxyas changed the title perf: reduce matching_root_macro_call usage perf: reduce matching_root_macro_call usage (23b -> 22.24b) Mar 23, 2026
Copy link
Copy Markdown
Contributor

@Jarcho Jarcho left a comment

Choose a reason for hiding this comment

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

@Jarcho Jarcho added this pull request to the merge queue Mar 24, 2026
Merged via the queue into rust-lang:master with commit 96c1c7a Mar 24, 2026
13 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

G-performance-project Goal: For issues and PRs related to the Clippy Performance Project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants