-
Notifications
You must be signed in to change notification settings - Fork 895
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
Speed up OptMergePass by 1.75x. #3975
Conversation
The main speedup comes from swithing from using a SHA1 hash to std::hash<std::string>. There is no need to use an expensive cryptographic hash for fingerprinting in this context.
You could probably use an even cheaper hash than SHA1. |
The change here is away from SHA1. |
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.
see the comments I made, plus a more general "IdString should be passed by value".
@Ravenslofty is there a setting to auto-squash my commits here? I noticed my commits didn't get squashed for the PRs you merged yesterday. |
There is, but I have the habit of "rebase and merge" to not lose history; if you want your commits squashed I can do that with my next merge. |
Btw @Ravenslofty we were discussing in the dev JF that doing merge commits is better since they have the PR number, which is otherwise lost. |
Well okay. |
OK, I'll leave that up to you. I'm just used to us squashing for Eigen. |
FWIW squash commits should have the PR number and are ok too, it's just the rebase that loses it. |
… and most hash function for uint64_t to hashlib.h to support this.
…atch with some compilers.
PTAL |
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.
Yeah, this looks much better.
I just ran the measurements again, and it actually ended up slightly faster too. Go figure... :-) |
The main speedup comes from switching away from using SHA1 hash to using
std::hash<std::string>
for fingerprinting cells. There is no need to use an expensive cryptographic hash for fingerprinting in this context.Flamegraph of benchmark timings from synthesis of a representative circuit:
Before:
After: