-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Get rid of EscapeDebugInner
.
#138237
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
base: master
Are you sure you want to change the base?
Get rid of EscapeDebugInner
.
#138237
Conversation
57c0a80
to
0854482
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I'm sure you know this, but if you highlight these lines, you can see that the trailing space is the problem. |
@thomcc I think it would make sense to see the perf impact of this change, since it is supposed to be an optimization (and increases the use of unsafe). Otherwise it seems hard to determine if this is a worthy trade-off. |
r? libs |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…er, r=<try> Get rid of `EscapeDebugInner`. I read the note on `EscapeDebugInner` and thought I'd give it a try.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (174fdb8): comparison URL. Overall result: no relevant changes - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (primary -0.4%, secondary 2.8%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary -0.5%, secondary 1.5%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResults (primary -0.0%, secondary -0.0%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 762.088s -> 762.832s (0.10%) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay, this looks reasonably good to me but I want to be sure I understand the design first.
pub escape_seq: [ascii::Char; N], | ||
pub literal: char, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the value of this being a union? Assuming N >= 4
, it seems like any char
s could just be written to escape_seq
to eliminate the union unsafety.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ascii::Char
only ranges from 0 to 127. So you would have to store both in [u8; N]
instead, and transmute both variants.
@rustbot author |
8b1d999
to
703b285
Compare
This comment has been minimized.
This comment has been minimized.
703b285
to
7ef10fc
Compare
I read the note on
EscapeDebugInner
and thought I'd give it a try.