Skip to content

Add AllowInternalUnstable enum to avoid Arc clones for static desugaring feature lists - #162969

Open
spastorino wants to merge 2 commits into
rust-lang:mainfrom
spastorino:ast_lowering_statics
Open

spastorino wants to merge 2 commits into
rust-lang:mainfrom
spastorino:ast_lowering_statics

Conversation

@spastorino

@spastorino spastorino commented Sep 18, 2026

Copy link
Copy Markdown
Member

This is exploratory followup of #162747

There are upsides and downsides of this. In particular, the bad part is that we grow ExpnData size by 8 bytes. The rest I think is way better this way.
Maybe we can do a perf run and see if it make things worse and decide.

r? @nnethercote

@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 Sep 18, 2026
@spastorino

Copy link
Copy Markdown
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 18, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 18, 2026
Add AllowInternalUnstable enum to avoid Arc clones for static desugaring feature lists
@rust-bors

rust-bors Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: f9f1546 (f9f1546379ba808fc075d149550371b9613a0314)
Base parent: 420ed2a (420ed2a0c3d7225b1744266fd884d431b4d8cfe0)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (f9f1546): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

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

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.2% [0.2%, 0.2%] 1
Improvements ✅
(primary)
-0.2% [-0.2%, -0.2%] 1
Improvements ✅
(secondary)
-0.2% [-0.3%, -0.1%] 3
All ❌✅ (primary) -0.2% [-0.2%, -0.2%] 1

Max RSS (memory usage)

Results (primary -0.0%, secondary -0.9%)

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

mean range count
Regressions ❌
(primary)
1.1% [0.8%, 1.4%] 2
Regressions ❌
(secondary)
2.2% [2.2%, 2.2%] 1
Improvements ✅
(primary)
-2.2% [-2.2%, -2.2%] 1
Improvements ✅
(secondary)
-2.4% [-3.6%, -1.2%] 2
All ❌✅ (primary) -0.0% [-2.2%, 1.4%] 3

Cycles

Results (primary 3.2%, secondary -0.5%)

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

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

Binary size

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

Bootstrap: 498.333s -> 500.939s (0.52%)
Artifact size: 408.93 MiB -> 408.97 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 18, 2026
@nnethercote

Copy link
Copy Markdown
Contributor

TBH I don't think this is worth it? If it improved performance, then yes. But without a perf improvement it's just a bit more complexity and code for no real gain.

@nnethercote nnethercote 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 Sep 19, 2026
@spastorino

Copy link
Copy Markdown
Member Author

This was originally an experiment, not very important and we can close it. My reasoning was different I feel the code is better in the sense that we were using an Arc in a very artificial way when what we really needed was a way to split between statically created lists of strs and dynamic ones. What the new enum does is just introducing this idea. I was more on the side of, if this doesn’t make perf worse is probably worth merging.

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

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

4 participants