-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Removes TraitMap::insert_for_type. #6867
Conversation
CodSpeed Performance ReportMerging #6867 will improve performances by 10.6%Comparing Summary
Benchmarks breakdown
|
61fed08
to
ee4d114
Compare
ee4d114
to
057d1ea
Compare
057d1ea
to
c3db20f
Compare
c3db20f
to
f17481b
Compare
f17481b
to
0b6370a
Compare
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'm not 100% I understand what's going on, but it looks ok.
The two comments I've made are mostly something that looks odd - I don't know if they're actual mistakes. Maybe it would be worth adding comments in those places to avoid future confusion.
e55642d
to
447a6e9
Compare
Some use cases require the compiler to call insert_implementation_for_type on every call of find_method_for_type. This would double the compile time of a simple script. To avoid this we removed the TraitMap::insert_for_type. The TraitMap now only stores the original implementations and uses a less restrictive unify_check to get those that match the concrete implementations. This reduces significantly the size of the TraitMap and speeds up the lookup times. On the other hand, it also introduces a type substitution on every find_method_for_type. A future PR will address the performance of doing type substitutions.
f2f4fde
to
284a008
Compare
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.
LGTM
nice 10% speed increase :) |
Description
Some use cases require the compiler to call insert_implementation_for_type on every call of find_method_for_type.
This would double the compile time of a simple script. To avoid this we removed the TraitMap::insert_for_type. The TraitMap now only stores the original implementations and uses a less restrictive unify_check to get those that match the concrete implementations.
This significantly reduces the TraitMap's size and speeds up the lookup times. On the other hand, it also introduces a type substitution on every find_method_for_type.
A future PR will address the performance of doing type substitutions.
Fixes #5002.
Fixes #6858
Checklist
Breaking*
orNew Feature
labels where relevant.