-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Box DiagnosticBuilder
.
#64374
Box DiagnosticBuilder
.
#64374
Conversation
r? @zackmdavis (rust_highfive has picked a reviewer for you, use r? to override) |
@bors try |
⌛ Trying commit 176bc8cb4c66adfbd2c4220ecf2f8718119e6ae1 with merge 10e8cb29dd1ac7824382d27c5b6e62eedaa42431... |
Is there a process by which you selected these specific cases to do the boxing? |
My strategy was "gotta box 'em all", because there's not much point only boxing some, and if you did, there isn't an obvious dividing line between boxed and non-boxed. Boxing within |
The main reason I would prefer to do an internal change is to make the developer UX better so that that "doing the wrong thing" is not possible here. I think I'd personally forget about your PR after a while and forget to do the manual boxing so not having to think about it would be neat. cc also @estebank |
Why is it memcpy'ed in the first place? Is it something that is supposed to be addressed by RVO, which rustc doesn't always do when it should right now? |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Indeed, and I would actually look at boxing the |
☀️ Try build successful - checks-azure |
It's a large type -- 176 bytes on 64-bit. And it's passed around and returned from a lot of functions, including within PResult. This commit boxes it, which reduces memory traffic. In particular, `PResult` shrinks to 16 bytes in the best case; this reduces instruction counts by up to 2% on various workloads.
176bc8c
to
2fcd870
Compare
I have updated the code to use an internal box. It made the patch much less invasive -- thanks for the suggestion, @Centril. I don't know why RVO isn't being applied. I just go where the profiler tells me to, and it told me that lots of I also fixed the mingw failure. @bors try |
⌛ Trying commit 2fcd870 with merge 25dba6526006eb8d4c2da901bcf74f00b4ed6383... |
Box `DiagnosticBuilder`. It's a large type -- 176 bytes on 64-bit. And it's passed around and returned from a lot of functions, including within `PResult`. This commit boxes it, which reduces memory traffic. In particular, `PResult` shrinks to 16 bytes in the best case; this reduces instruction counts by up to 2% on various workloads. The commit touches a lot of lines but it's almost all trivial plumbing changes.
☀️ Try build successful - checks-azure |
@rust-timer build f81c392 |
Success: Queued f81c392 with parent f0b58fc, comparison URL. |
Finished benchmarking try commit f81c392, comparison URL. |
The perf results look good, reducing instruction counts by up to 2.6%. |
Great! 💖 @bors r+ |
📌 Commit 2fcd870 has been approved by |
…r=zackmdavis Box `DiagnosticBuilder`. It's a large type -- 176 bytes on 64-bit. And it's passed around and returned from a lot of functions, including within `PResult`. This commit boxes it, which reduces memory traffic. In particular, `PResult` shrinks to 16 bytes in the best case; this reduces instruction counts by up to 2% on various workloads. The commit touches a lot of lines but it's almost all trivial plumbing changes.
…r=zackmdavis Box `DiagnosticBuilder`. It's a large type -- 176 bytes on 64-bit. And it's passed around and returned from a lot of functions, including within `PResult`. This commit boxes it, which reduces memory traffic. In particular, `PResult` shrinks to 16 bytes in the best case; this reduces instruction counts by up to 2% on various workloads. The commit touches a lot of lines but it's almost all trivial plumbing changes.
…r=zackmdavis Box `DiagnosticBuilder`. It's a large type -- 176 bytes on 64-bit. And it's passed around and returned from a lot of functions, including within `PResult`. This commit boxes it, which reduces memory traffic. In particular, `PResult` shrinks to 16 bytes in the best case; this reduces instruction counts by up to 2% on various workloads. The commit touches a lot of lines but it's almost all trivial plumbing changes.
Rollup of 17 pull requests Successful merges: - #63846 (Added table containing the system calls used by Instant and SystemTime.) - #64116 (Fix minor typo in docs.) - #64203 (A few cosmetic improvements to code & comments in liballoc and libcore) - #64302 (Shrink `ObligationCauseCode`) - #64372 (use randSecure and randABytes) - #64374 (Box `DiagnosticBuilder`.) - #64375 (Fast path for vec.clear/truncate ) - #64378 (Fix inconsistent link formatting.) - #64384 (Trim rustc-workspace-hack) - #64393 ( declare EnvKey before use to fix build error) - #64420 (Inline `mark_neighbours_as_waiting_from`.) - #64422 (Remove raw string literal quotes from error index descriptions) - #64423 (Add self to .mailmap) - #64425 (typo fix) - #64431 (fn ptr is structural match) - #64435 (codegen: use "_N" (like for other locals) instead of "argN", for argument names.) - #64439 (fix #64430, confusing `owned_box` error message in no_std build) Failed merges: r? @ghost
It's a large type -- 176 bytes on 64-bit. And it's passed around and
returned from a lot of functions, including within
PResult
.This commit boxes it, which reduces memory traffic. In particular,
PResult
shrinks to 16 bytes in the best case; this reduces instructioncounts by up to 2% on various workloads. The commit touches a lot of
lines but it's almost all trivial plumbing changes.