Skip to content
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

macro_rules: Add an expansion-local cache to span marker #119693

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

petrochenkov
Copy link
Contributor

Most tokens in a macro body typically have the same syntax context.
So the cache should usually be hit.

This change can either be combined with #119689, or serve as its alternative, depending on perf results.

@rustbot
Copy link
Collaborator

rustbot commented Jan 7, 2024

r? @compiler-errors

(rustbot has picked a reviewer for you, use r? to override)

@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 Jan 7, 2024
@petrochenkov
Copy link
Contributor Author

@bors try @rust-timer queue

@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 Jan 7, 2024
@petrochenkov petrochenkov removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 7, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 7, 2024
macro_rules: Add an expansion-local cache to span marker

Most tokens in a macro body typically have the same syntax context.
So the cache should usually be hit.

This change can either be combined with rust-lang#119689, or serve as its alternative, depending on perf results.
@bors
Copy link
Contributor

bors commented Jan 7, 2024

⌛ Trying commit e1c08d6 with merge 44345bd...

@bors
Copy link
Contributor

bors commented Jan 7, 2024

☀️ Try build successful - checks-actions
Build commit: 44345bd (44345bd55c7e750b6d039208576d3e2db2ea9d9e)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (44345bd): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.1% [3.1%, 3.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.7% [-2.5%, -0.2%] 69
Improvements ✅
(secondary)
-0.8% [-1.9%, -0.3%] 13
All ❌✅ (primary) -0.7% [-2.5%, 3.1%] 70

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.6% [2.0%, 5.6%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.3% [-3.3%, -3.2%] 2
All ❌✅ (primary) - - 0

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

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

Binary size

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

Bootstrap: 665.728s -> 666.41s (0.10%)
Artifact size: 308.41 MiB -> 308.39 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 7, 2024
@cjgillot
Copy link
Contributor

cjgillot commented Jan 7, 2024

r=me with an in-code comment explaining why we need the local cache.

@petrochenkov
Copy link
Contributor Author

@bors r=cjgillot

@bors
Copy link
Contributor

bors commented Jan 8, 2024

📌 Commit edec91d has been approved by cjgillot

It is now in the queue for this repository.

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 8, 2024
@bors
Copy link
Contributor

bors commented Jan 8, 2024

⌛ Testing commit edec91d with merge 0ee9cfd...

@bors
Copy link
Contributor

bors commented Jan 8, 2024

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing 0ee9cfd to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 8, 2024
@bors bors merged commit 0ee9cfd into rust-lang:master Jan 8, 2024
12 checks passed
@rustbot rustbot added this to the 1.77.0 milestone Jan 8, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0ee9cfd): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.4% [-20.5%, -0.2%] 80
Improvements ✅
(secondary)
-0.8% [-1.9%, -0.3%] 16
All ❌✅ (primary) -1.4% [-20.5%, -0.2%] 80

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.6% [1.2%, 4.5%] 4
Improvements ✅
(primary)
-4.9% [-5.6%, -4.1%] 3
Improvements ✅
(secondary)
-5.3% [-9.6%, -1.1%] 2
All ❌✅ (primary) -4.9% [-5.6%, -4.1%] 3

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-12.8% [-18.8%, -2.9%] 4
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -12.8% [-18.8%, -2.9%] 4

Binary size

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

Bootstrap: 666.019s -> 667.831s (0.27%)
Artifact size: 308.38 MiB -> 308.39 MiB (0.00%)

@Kobzol
Copy link
Contributor

Kobzol commented Jan 8, 2024

The bit bitmaps win is a reverse of a blip from #119722 (comment).

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. 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.

7 participants