-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Rewrite MemDecoder around pointers not a slice #110634
Conversation
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 708c71bc9fed44627872cff4d24018b17905f0fa with merge ea67749271a3bfca6996cc4b8becfa7a0591f9ab... |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (ea67749271a3bfca6996cc4b8becfa7a0591f9ab): 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 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.
|
3d25012
to
2995eb3
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 2995eb38309270f12efb8a8d43ba82cf6fdb4000 with merge 441c638841629089f54e4aa6da3960f27bbfac6d... |
☀️ Try build successful - checks-actions |
1 similar comment
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (441c638841629089f54e4aa6da3960f27bbfac6d): 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 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.
CyclesThis benchmark run did not return any relevant results for this metric. |
r? compiler |
⌛ Testing commit 1f67ba6 with merge f5d087af3c1f1f1cd92ce34419bd874002eca742... |
💔 Test failed - checks-actions |
@bors retry |
⌛ Testing commit 1f67ba6 with merge 9abd3bce4eec20d550601dbfd2f024f5e896f635... |
💔 Test failed - checks-actions |
A job failed! Check out the build log: (web) (plain) Click to see the possible cause of the failure (guessed by this bot)
|
@bors retry |
☀️ Test successful - checks-actions |
Finished benchmarking commit (adaac6b): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression 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.
|
This is basically #109910 but I'm being a lot more aggressive. The pointer-based structure means that it makes a lot more sense to absorb more complexity into
MemDecoder
, most of the diff is just complexity moving from one place to another.The primary argument for this structure is that we only incur a single bounds check when doing multi-byte reads from a
MemDecoder
. With the slice-based implementation we need to do those withdata[position..position + len]
, which needs to account forposition + len
wrapping. It would be possible to dodge the first bounds check if we stored a slice that starts atposition
, but that would require updating the pointer and length on every read.This PR also embeds the failure path in a separate function, which means that this PR should subsume all the perf wins observed in #109867.