perf: Don't hash the key when searching in empty hash tables#2471
Closed
hargoniX wants to merge 1 commit intoleanprover:masterfrom
Closed
perf: Don't hash the key when searching in empty hash tables#2471hargoniX wants to merge 1 commit intoleanprover:masterfrom
hargoniX wants to merge 1 commit intoleanprover:masterfrom
Conversation
Collaborator
|
@hargoniX, I think anyone is allowed to run !bench |
Collaborator
|
Apparently not! @Kha, I'm presuming you need to sprinkle some magic permissions bits here? |
kim-em
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Aug 30, 2023
Member
|
!bench |
Collaborator
|
Here are the benchmark results for commit 1262a41. |
Collaborator
|
Collaborator
|
Collaborator
|
Here are the bench results on Mathlib: http://speed.lean-fro.org/mathlib4/compare/93695581-e592-41ad-9a6a-53fe2cce9e75/to/e760a006-736d-49ba-b9b4-d6d79e4f697f. I think without any interesting performance gain we can put this one to rest? |
Contributor
Author
|
@digama0 would you like to have this optimization on the std4 HashMap? |
Collaborator
|
I was planning on it if this landed, but if the performance impact isn't there I'm not sure. The results seem to be slightly negative. |
Collaborator
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on: rust-lang/hashbrown#305
Judging from the rustc benchmarks this can save significant amounts of instructions and seems like quite a simple change. It is however unclear to me whether we do have the usage pattern of HashMaps that they do somewhere so it might possibly be useless for us as well. I don't have a local benchmark setup so we have to run performance tests here if we are interested in this. I'm guessing I don't have the privileges for that?