-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[Optimization
]: Make murmur32 appendable and faster.
#3760
base: master
Are you sure you want to change the base?
Conversation
/// </summary> | ||
/// <param name="data">The input to compute the hash code for.</param> | ||
/// <returns>The computed hash code in uint.</returns> | ||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
public uint ComputeHashUInt32(ReadOnlySpan<byte> data) | ||
{ | ||
Initialize(); | ||
Reset(); |
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.
It doesn't reset twice when only one is computed?
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.
It doesn't reset twice when only one is computed?
Cannot.
Because the ComputeHashUInt32
may be called multi times.
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.
It doesn't reset twice when only one is computed?
The overhead of Reset
is trivial.
Description
Implement
NonCryptographicHashAlgorithm
forMurmure32
.And make it faster.
Before:
After:
Type of change
Checklist: