-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Optimize ToString
implementation for integers
#136264
base: master
Are you sure you want to change the base?
Optimize ToString
implementation for integers
#136264
Conversation
Could not assign reviewer from: |
rustbot has assigned @Mark-Simulacrum. Use |
This comment has been minimized.
This comment has been minimized.
I'm very confused by the CI errors. Did I unfold a very weird bug somehow? Like |
specialization strikes again, perhaps |
It seems to me that the tests are testing for a known miscompilation: #107975 |
I'm guessing that this PR caused the compiler to be able to figure out that calling to_string on a number doesn't cause that number to change, allowing more optimizations to happen, causing the miscompilation to behave differently. |
lovely. |
Fixed CI. So now about benching the change: any suggestion @workingjubilee ? In the meantime: @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…string, r=<try> Optimize `ToString` implementation for integers Part of rust-lang#135543. Follow-up of rust-lang#133247 and rust-lang#128204. Rather than writing pretty bad benchers like I did last time, `@workingjubilee:` do you have a suggestion on how to check the impact on performance for this PR? Thanks in advance! r? `@workingjubilee`
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (97c5b4b): comparison URL. Overall result: ✅ improvements - 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 is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 0.3%, secondary 2.1%)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.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeResults (primary 0.1%, secondary 0.2%)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: 776.287s -> 777.396s (0.14%) |
I don't believe the tests should be changed in this way. |
I'm not sure if we should keep the code and modify it (like I did) or just comment out the parts that are failing. Or maybe you see a third way? |
The point of these tests is the series of asserts, changing just one line or two that fails undermines the point. |
The point was testing that calling |
These are known-bug tests. They are testing for the existence of a bug. We did not fix the bug, because there are other ways to reach the compilation quirks in question. They have little to nothing to do with |
Oh I see. So in short, calling any method on the type should still trigger the original bug iiuc. Let me give it a try. In the meantime, any idea on how to bench this PR? |
83dc76e
to
1713773
Compare
You were right, just calling another method did the trick. Tests are now back to what they were. |
Thank you. I will think about that a bit. |
☔ The latest upstream changes (presumably #135265) made this pull request unmergeable. Please resolve the merge conflicts. |
1713773
to
86056b0
Compare
Fixed merge conflicts. Also cc @tgross35 since you mentioned you were also working on this. |
r? @workingjubilee (I guess) -- happy to get re-rolled but seems like you might have more context here? |
Could not assign reviewer from: |
If I am I'm not aware of it :) |
Oh, there was some confusion on another issue - I'm working on float string conversions, not integers. |
Part of #135543.
Follow-up of #133247 and #128204.
Rather than writing pretty bad benchers like I did last time, @workingjubilee: do you have a suggestion on how to check the impact on performance for this PR? Thanks in advance!
r? @workingjubilee