-
Notifications
You must be signed in to change notification settings - Fork 17.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
sync: improve Map performance with lock free list #54720
Comments
If there are no API changes, this doesn't need to be a proposal, so taking out of the proposal process. CC @bcmills |
Worth noting that this uses the xxhash hashing algorithm, which I believe is not in the standard library right now. Could we use Go's maphash instead, perhaps? |
Looks neat. Although, while testing the implementation, this benchmark doesn't seem to complete:
Running with concurrency 32, amd64. If I change I also recommend using the same resize algorithm as And as @mvdan mentioned, try benchmarking using the same hashing algorithm as std; this shows that the benefit isn't just from replacing the hashing algorithm. |
Will look into it
Agreed I was also looking to improve the current resizing algorithm of haxmap as well
Got it, I will try benchmarking with golang std hash as well and compare it with the current xxHash based implementation |
This happens because of small map size and lots of grow operations which run as goroutines. These goroutines cause the slowdown. One option is handle There is an open issue for this as well alphadose/haxmap#2 |
Also, I recommend comparing with #54766 |
Compare #47643 (CC @puzpuzpuz), #21035, #21032. How would this affect pointer overheads in the steady state? (See #21031.) |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
I was fixing most of the issues in haxmap to make it a stable version as in https://github.com/alphadose/haxmap/releases/tag/v1.0.0 Wanted it to work correctly before making any comparisons Hence there is no need to close this issue, it is being actively worked upon |
That's fine. Typically we use the bot to close issues which were waiting on a reply for too long because the majority simply become stale and non-actionable. |
@mvdan comparison of xxHash vs golang maphash in the context of haxmap over 20 cases
Benchmarking code is available here https://github.com/alphadose/haxmap/blob/hash-comparison/benchmarks/map_test.go, kindly crosscheck to ensure the comparisons are done fairly |
Reference -> https://github.com/alphadose/haxmap
Hashing algorithm used -> https://github.com/Cyan4973/xxHash
Map buckets were implemented using Harris lock-free list
The text was updated successfully, but these errors were encountered: