-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Add some targeted assume(bytes <= isize::MAX)
around slices
#123575
Conversation
); | ||
intrinsics::assume(len <= T::MAX_SLICE_LEN); |
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.
Given this was already assert_unsafe_precondition
ed, might as well assume
it too.
(Not using assert_unchecked
because it doesn't need a second UbCheck
.)
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Add some targeted `assume(bytes <= isize::MAX)` around slices Putting it on every single slice length was pretty expensive, but let's see if doing it just in `slice::from_raw_parts(_mut)` and `slice::Iter(Mut)::len` works better.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (a4009ef): comparison URL. Overall result: ❌✅ regressions and improvements - 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. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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 sizeResultsThis 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: 670.181s -> 676.772s (0.98%) |
…ed, r=<try> Have `offset_from_unsigned` assume the `isize::MAX` restriction Split off from rust-lang#123575; hopefully this won't be as perf-painful. (Notably it doesn't change MIR, so hopefully can't affect check/debug.)
Putting it on every single slice length was pretty expensive, but let's see if doing it just in `slice::from_raw_parts(_mut)` and `slice::Iter(Mut)::len` works better.
2be8c36
to
5c95280
Compare
Split off half of it over to #123598; let's see just this bit. @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Add some targeted `assume(bytes <= isize::MAX)` around slices Putting it on every single slice length was pretty expensive, but let's see if doing it just in `slice::from_raw_parts(_mut)` ~~and `slice::Iter(Mut)::len`~~ works better.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (ada8fc8): comparison URL. Overall result: ❌✅ regressions and improvements - 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. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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 sizeResultsThis 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: 667.449s -> 673.747s (0.94%) |
Wow, even worse. Clearly we can't do this. |
Putting it on every single slice length was pretty expensive, but let's see if doing it just in
slice::from_raw_parts(_mut)
andworks better.slice::Iter(Mut)::len