rayon: Use parallel iterators within shards#360
Open
purplesyringa wants to merge 1 commit intoxacrimon:masterfrom
Open
rayon: Use parallel iterators within shards#360purplesyringa wants to merge 1 commit intoxacrimon:masterfrom
purplesyringa wants to merge 1 commit intoxacrimon:masterfrom
Conversation
Contributor
|
Yes, that was the intent of my comment. It's still tough to judge if we should do this though. If the shards are reasonably well balanced to begin with, then the inner parallelism won't help much, and might even hurt a little with the additional overhead of more parallel splits. It would be good to collect some measurements if there are any |
Owner
|
Yeah, I'm happy to merge this if there's high quality benchmarks to support it. I don't have the time to perform such a study myself at the moment and my gut feeling is that this is going to be at best a net zero. Rayon scheduling does have measurable overhead and assuming a sane hash function, shards should have nearly equal element counts. |
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.
#116 added rayon support, but parallelized only across shards, since std's hashmap does not support parallelization. Since dashmap exclusively uses hashbrown since #259, we can use hashbrown's rayon support for parallel iterators inside the hashmap.
This sounds like an obvious win in theory, but I'm not very familiar with rayon and I'm not sure if there could be some overhead from scheduling. Perhaps @cuviper could say if this is what he had in mind when writing the "implementation note" comment?