Skip to content

Reland debug impl for fieldless enums with concatenated string without using discriminant_value - #162535

Draft
panstromek wants to merge 3 commits into
rust-lang:mainfrom
panstromek:reland-debug-opt
Draft

Reland debug impl for fieldless enums with concatenated string without using discriminant_value#162535
panstromek wants to merge 3 commits into
rust-lang:mainfrom
panstromek:reland-debug-opt

Conversation

@panstromek

@panstromek panstromek commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Let's see whether this is still benefitial. If yes, then I'll clean this up.

relands #155452
reverts #162164

@rustbot rustbot added 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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 9, 2026
@panstromek

Copy link
Copy Markdown
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 Sep 9, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 9, 2026
Reland debug impl for fieldless enums with concatenated string without using discriminant_value
@rust-bors

rust-bors Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 6ff0c29 (6ff0c293700f750741ca037a07d54262de940377)
Base parent: eca445e (eca445e5ae4a6679cc27d3a09106ce245e13a5a6)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (6ff0c29): comparison URL.

Overall result: ❌ regressions - 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.1% [0.1%, 0.1%] 1
Regressions ❌
(secondary)
0.3% [0.2%, 0.5%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.1%, 0.1%] 1

Max RSS (memory usage)

Results (primary 0.8%, secondary -0.0%)

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

mean range count
Regressions ❌
(primary)
2.2% [0.5%, 5.2%] 4
Regressions ❌
(secondary)
3.8% [3.8%, 3.8%] 1
Improvements ✅
(primary)
-2.2% [-2.4%, -2.0%] 2
Improvements ✅
(secondary)
-1.9% [-2.4%, -1.5%] 2
All ❌✅ (primary) 0.8% [-2.4%, 5.2%] 6

Cycles

Results (primary 1.0%, secondary 5.9%)

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

mean range count
Regressions ❌
(primary)
1.5% [0.4%, 3.5%] 7
Regressions ❌
(secondary)
5.9% [5.9%, 5.9%] 1
Improvements ✅
(primary)
-0.7% [-0.7%, -0.6%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.0% [-0.7%, 3.5%] 9

Binary size

Results (primary 0.1%, secondary 4.2%)

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

mean range count
Regressions ❌
(primary)
0.2% [0.0%, 1.7%] 39
Regressions ❌
(secondary)
4.2% [0.0%, 13.7%] 21
Improvements ✅
(primary)
-0.4% [-0.7%, -0.0%] 16
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [-0.7%, 1.7%] 55

Bootstrap: 481.923s -> 481.101s (-0.17%)
Artifact size: 403.28 MiB -> 403.16 MiB (-0.03%)

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

Copy link
Copy Markdown
Contributor Author

Replacing discriminant_value with match => variant_index sadly doesn't help much. The generated MIR looks somewhat better than the default match => &str variant (there's less code in each arms basic block), but without the O(n) reduction in basic blocks, it doesn't seem to be worth it.

@rust-bors

rust-bors Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #162631) made this pull request unmergeable. Please resolve the merge conflicts by rebasing.

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

3 participants