Fix prefetchNextBucketEntries so it fetches the correct next 2 buckets. #2394
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.
This PR fixes a bug in prefetchNextBucketEntries which is used in the hashtable iterator. The current version of prefetchNextBucketEntries does not correctly prefetch the next two buckets that will be iterated over. This is due next_index being incremented twice (once in prefetchNextBucketEntries and again in getNextBucket).
Fix Explanation:
Performance
The fix was tested in a similar manner as #1501 where these changes were introduced.
All the data below was taken on a
The data below was collected by executing the KEYS * command and Save command on a 64-logical core (32 physical cores, 2 threads per core) AMD EPYC 7B13 processor. The dataset had 50 million keys with a value size of 100 bytes each.
KEYS * Command
Improvement:
Save command improvement
Setup:
Results
Improvement: