-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Make the inherent impl overlap check linear-time #69009
Make the inherent impl overlap check linear-time #69009
Conversation
r? @cramertj (rust_highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit 11c7e82 with merge 696990e8079f8a668b38304d45e9528acaa5aca4... |
☀️ Try build successful - checks-azure |
Queued 696990e8079f8a668b38304d45e9528acaa5aca4 with parent 71c7e14, future comparison URL. |
Finished benchmarking try commit 696990e8079f8a668b38304d45e9528acaa5aca4, comparison URL. |
Looks like this causes a slight regression in |
Ping from triage: @jonas-schievink - can you please post your status or close this PR? |
Despite #68911, this code was still showing up in profiles, so I turned it from a O(n²) comparison between all inherent impls to an O(n) algorithm that builds an intermediate hash map to find items with the same names. It also makes the code a bit clearer.
The actual performance gains I've measured are pretty small (1-3%), and it's not impossible that the hash map has a negative perf impact in some situations, so I'll query perf for this.