Repository navigation
perf: emit field names as a concatenated string in derive(Debug) for structs - #164726
panstromek wants to merge 15 commits into
Conversation
|
perf test for field names of large structs. This probably won't be as visible, there's not that many of those. I'll try to pick only benchmarks that that have those + 2 other ones as a spot check. @bors try |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Use concatenated string in more debug derives
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (455d3ee): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. @bors rollup=never 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.7%, secondary -2.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -0.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: missing data |
|
Nice, looks better than I expected. This makes sense, the best result is |
f43fa07 to
219cd16
Compare
|
r? nnethercote Are you ok if I keep assigning you these things or should I let rustbot roll the dice? I've been assigning you almost everything lately, but that's just because I work on things you implemented and I try to pick reviewer based on who worked on the relevant code. |
|
Changes to the code generated for builtin derived traits. cc @nnethercote |
|
Nice idea! Can you do the same thing for No problem with the reviews. I always ask an appropriate person directly instead of letting the random choice happen. |
Oh, that's another question I have. I was going to try that in a separate PR to separate the impact, do you prefer to do all of them at once? |
|
It's such a closely related change, might as well do it here. Can be a separate commit if you want. |
|
Let's see how this works out for smaller structs. I'm a bit worried tbh. I think this should be better as far as the generated code goes, because the MIR will be smaller, but there's also more Symbol manipulation and interning, so it might not be so clear cut. @bors try @rust-timer queue Note: I went a bit further and concatenated struct name with the fields as well. This was simpler to do in the |
This comment has been minimized.
This comment has been minimized.
perf: emit field names as a concatenated string in derive(Debug) for large structs
This comment has been minimized.
This comment has been minimized.
2ec69fe to
4719ede
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
rebased @rustbot ready |
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
perf: emit field names as a concatenated string in derive(Debug) for structs Similar idea as #162535 and previous attempts. Again, I also noticed that no test fails when I mess up the string, so I added a test case.
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
💔 Test for a5788b1 failed: CI. Failed job:
|
|
@bors retry Seems to be our spurious failure of the week |
|
Is this PR's history intentional? 15 commits with short descriptions seems like quite a lot, but as long as there isn't back-and-forth... |
Yes, I'm used to doing fairly granular atomic commits to separate changes from each other. But feel free to squash it with bors if it feels like too much. |
|
No worries, I'm a fan of atomic commits too. Just making sure since some of the cleanups were a bit small :) |
|
@bors rollup=iffy |
…ethercote perf: emit field names as a concatenated string in derive(Debug) for structs Similar idea as rust-lang#162535 and previous attempts. Again, I also noticed that no test fails when I mess up the string, so I added a test case.
…ethercote perf: emit field names as a concatenated string in derive(Debug) for structs Similar idea as rust-lang#162535 and previous attempts. Again, I also noticed that no test fails when I mess up the string, so I added a test case.
…uwer Rollup of 5 perf-sensitive pull requests Successful merges: - #165032 (stdarch subtree update) - #163525 (Move lang item collection to the resolver) - #164234 (New solver opts for `diesel` (part 2)) - #164726 (perf: emit field names as a concatenated string in derive(Debug) for structs) - #164953 (Avoid stdlib's `impl Hash for Discriminant` for stable hashing)
…ethercote perf: emit field names as a concatenated string in derive(Debug) for structs Similar idea as rust-lang#162535 and previous attempts. Again, I also noticed that no test fails when I mess up the string, so I added a test case.
View all comments
Similar idea as #162535 and previous attempts.
Again, I also noticed that no test fails when I mess up the string, so I added a test case.