Uh oh!
There was an error while loading. Please reload this page.
Faster parsing for lower numbers for radix up to 16 (cont.) - #95399
Conversation
Co-authored-by: LingMan <LingMan@users.noreply.github.com>
Co-authored-by: LingMan <LingMan@users.noreply.github.com>
Co-authored-by: Ivan Tham <pickfire@riseup.net>
Co-authored-by: LingMan <LingMan@users.noreply.github.com>
rust-highfive
commented
Mar 28, 2022
r? @scottmcm (rust-highfive has picked a reviewer for you, use r? to override) |
gilescope
commented
Mar 28, 2022
A mate points out that we could pull that condition out into a separate function and slather it in tests (assuming that we slap an inline always on it). I really like that idea. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
scottmcm
left a comment
There was a problem hiding this comment.
The idea here sounds good; I've left some details comments.
One additional request: Please make sure there are a bunch of #[test]s in the core tests that hit around the edges of the unsafe-using paths here. We run those tests in MIRI, which should help get extra checking that the unchecked usage is sound.
A mate points out that we could pull that condition out into a separate function and slather it in tests (assuming that we slap an inline always on it). I really like that idea.
Are you planning on doing this before requesting final approval?
This comment has been minimized.
This comment has been minimized.
gilescope
commented
Apr 2, 2022
Yeah let's get those additional tests done before we hit merge. I want to be absolutely sure about this. |
gilescope
commented
Apr 2, 2022
Have extracted |
This comment has been minimized.
This comment has been minimized.
gilescope
commented
Apr 2, 2022
I guess I could make it a public function but add something like this: #[doc(hidden)]#[unstable(issue = "none", feature = "std_internals")] |
gilescope
commented
Apr 4, 2022
I realised we can use default() to get zero which seems a bit nicer. |
gilescope
commented
Apr 4, 2022
Right I feel happier with that now - if anyone optimised that condition in an unsafe way the test would likely catch it. |
This comment has been minimized.
This comment has been minimized.
gilescope
commented
Apr 10, 2022
Great build fails because it's really hard to figure out if a type is signed in rust... maybe it's not even possible at the moment without using FromStrRadixHelper ... |
Uh oh!
There was an error while loading. Please reload this page.
scottmcm
commented
Apr 11, 2022
It's just that there's a few CI builders that enable debug/overflow checks to check for mistakes in the implementations (otherwise the So that test failure is concerning. What subtraction is overflowing in the "it shouldn't overflow" path? |
gilescope
commented
Apr 11, 2022
H/T to @koute for pointing out an easier way to do is signed. Test failure is no more. It was just a poor is signed implementation (in the test only). |
Uh oh!
There was an error while loading. Please reload this page.
scottmcm
commented
Apr 12, 2022
Thanks! This looks good, and the final iteration @bors r+ |
bors
commented
Apr 12, 2022
📌 Commit 3ee7bb1 has been approved by |
bors
commented
Apr 12, 2022
bors
commented
Apr 12, 2022
☀️ Test successful - checks-actions |
gilescope
commented
Apr 12, 2022
rust-timer
commented
Apr 12, 2022
Finished benchmarking commit (4e1927d): comparison url. Summary:
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Footnotes |
klensy
commented
Apr 12, 2022
Is there somewhere posted benches and\or godbolt where changes actually visible? Reading this PR, i didn't find anything, plus description don't help. |
gilescope
commented
Apr 12, 2022
It's retrograde for radix_36 and i8 but everything else benefits. We did have a godbolt a long while ago. I can try and set one up again. There's a bit of munging of the code to do to get something equivalent so it will take me a little time. |
Fix spelling in docs for `can_not_overflow` Introduced in rust-lang#95399
Fix spelling in docs for `can_not_overflow` Introduced in rust-lang#95399
Fix spelling in docs for `can_not_overflow` Introduced in rust-lang#95399
gilescope
commented
Apr 14, 2022
There's a followup PR being drafted to address the regression - I had an idea before going to sleep (we are wasting a mul). |
Fix spelling in docs for `can_not_overflow` Introduced in rust-lang/rust#95399
( Continuation of #83371 )
With LingMan's change I think this is potentially ready.