-
Notifications
You must be signed in to change notification settings - Fork 13.4k
make for_all_relevant_impls
O(1) again
#43723
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
82fdfaa
to
4c8683a
Compare
@bors p=100 (no rolling up) |
Presumably updates to submodules are unintentional? |
A change in rust-lang#41911 had made `for_all_relevant_impls` do a linear scan over all impls, instead of using an HashMap. Use an HashMap again to avoid quadratic blowup when there is a large number of structs with impls. I think this fixes rust-lang#43141 completely, but I want better measurements in order to be sure. As a perf patch, please don't roll this up.
4c8683a
to
453ad81
Compare
Yup. Fixed |
@bors r+ |
📌 Commit 453ad81 has been approved by |
make `for_all_relevant_impls` O(1) again A change in #41911 had made `for_all_relevant_impls` do a linear scan over all impls, instead of using an HashMap. Use an HashMap again to avoid quadratic blowup when there is a large number of structs with impls. I think this fixes #43141 completely, but I want better measurements in order to be sure. As a perf patch, please don't roll this up. r? @eddyb beta-nominating because regression
☀️ Test successful - status-appveyor, status-travis |
cc @rust-lang/compiler, any thoughts about a backport here? |
This improved the memory usage of nearly all incremental-related benchmarks by up to 25%. 🌴 |
Accepted for beta. Not so small, but very important compile time regression. cc @rust-lang/compiler |
A change in #41911 had made
for_all_relevant_impls
do a linear scan overall impls, instead of using an HashMap. Use an HashMap again to avoid
quadratic blowup when there is a large number of structs with impls.
I think this fixes #43141 completely, but I want better measurements in
order to be sure. As a perf patch, please don't roll this up.
r? @eddyb
beta-nominating because regression