Repository navigation
More derive(Debug) cleanups for structs - #165140
Conversation
They have the same signature now, so we can unify them. The implementation for tuple is selected based on whether the concatenated string contains field names.
|
Changes to the code generated for builtin derived traits. cc @nnethercote
cc @Amanieu, @folkertdev, @sayantn |
|
This could maybe help std size and binary size. @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
More derive(Debug) cleanups for structs
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (1f87bc3): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @bors rollup=iffy rustc-perf Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -0.9%, secondary -0.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 0.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.4%, secondary 0.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 487.353s -> 485.918s (-0.29%) |
|
@rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
I think it's still ok (the concatenation change made it 30% slower), but there's of course a question of how much can we make the debug impls slower to help other metrics. I still assume most of this code in the ecosystem is either dead or used extremely rarely and for a small number of things at once, so I place it on a similar level as a panic path. Not sure that's always the right assumption Either way, I want try whether we can make it little better, I suspect the @rustbot ready |
|
@bors r+ |
|
This pull request was unapproved. |
|
Ok, I think I've handled all of those now - Let's check perf as well. @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
More derive(Debug) cleanups for structs
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…impl for c like enums
This comment has been minimized.
This comment has been minimized.
a4331d4 to
8cde1fb
Compare
|
fixed clippy, should be good now (I don't expect perf run to show problems) @rustbot ready |
|
Finished benchmarking commit (2207ca9): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @bors rollup=iffy rustc-perf Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary 4.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -1.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.4%, secondary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 484.843s -> 486.345s (0.31%) |
|
@bors r+ |
Rollup merge of #165140 - panstromek:derive-debug-cleanups, r=nnethercote More derive(Debug) cleanups for structs This removes duplication from the debug helpers and unifies tuples with structs. More details in individual commits. I think this is makes the code simpler, but it's a bit of a judgement call. r? nnethercote
…uwer Rollup of 2 pull requests Successful merges: - rust-lang/rust#165140 (More derive(Debug) cleanups for structs) - rust-lang/rust#165160 (New solver opts for diesel (part 3))
|
Note This PR was benchmarked as part of triage of its containing rollup: triage URL. Finished benchmarking commit (d4ef51e): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary 2.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesThis perf run didn't have relevant results for this metric. Binary sizeResults (primary -0.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Artifact size: 406.62 MiB -> 406.61 MiB (-0.00%) |
View all comments
This removes duplication from the debug helpers and unifies tuples with structs.
More details in individual commits.
I think this is makes the code simpler, but it's a bit of a judgement call.
r? nnethercote