-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Remove LazyMeta::min_size #92497
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
Remove LazyMeta::min_size #92497
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit c47b3836097d859942d4d9aa6fb8bd798b4efad2 with merge 66f0299604f575b12a6356529d3fb1d7e72505bb... |
☀️ Try build successful - checks-actions |
Queued 66f0299604f575b12a6356529d3fb1d7e72505bb with parent 03360be, future comparison URL. |
Finished benchmarking commit (66f0299604f575b12a6356529d3fb1d7e72505bb): comparison url. Summary: This change led to small relevant improvements 🎉 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking 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 led to changes in compiler perf. @bors rollup=never |
r? @eddyb how knows this code much better than me |
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.
r=me with that comment tweaked to not say "conservative estimate"
// FIXME(eddyb) Give better estimates for certain types. | ||
fn min_size(meta: Self::Meta) -> usize; |
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.
I suppose I had hoped to be able to predict certain sizes well enough to have a lot of single-byte LEB128 encodings, but in retrospect it doesn't seem doable without a bunch of custom derives. In most cases, distances under 128 wouldn't make a difference anyway, and I suspect that's most of what min_size
could ever handle (outside of Lazy<[T]>
, I suppose).
It is extremely conservative and as such barely reduces the size of encoded Lazy distances, but does increase complexity.
c47b383
to
717d4b3
Compare
@bors r=eddyb |
📌 Commit 717d4b3 has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (02fe61b): comparison url. Summary: This benchmark run did not return any relevant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
It is extremely conservative and as such barely reduces the size of encoded Lazy distances, but does increase complexity.