Reduce lock contention in UsageTrackingQueryCachingPolicy#16306
Open
prudhvigodithi wants to merge 2 commits into
Open
Reduce lock contention in UsageTrackingQueryCachingPolicy#16306prudhvigodithi wants to merge 2 commits into
UsageTrackingQueryCachingPolicy#16306prudhvigodithi wants to merge 2 commits into
Conversation
prudhvigodithi
force-pushed
the
assert
branch
2 times, most recently
from
June 30, 2026 13:47
a02f13a to
8190057
Compare
prudhvigodithi
force-pushed
the
assert
branch
2 times, most recently
from
June 30, 2026 15:10
b92b390 to
f9cfc32
Compare
Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com>
Contributor
|
This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the dev@lucene.apache.org list. Thank you for your contribution! |
Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com>
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.
Description
After split LRUQueryCache into 16 partitions with separate locks, concurrent cache insertions no longer wait for each other. UsageTrackingQueryCachingPolicy still does, every onUse() and frequency() call funnels through one shared synchronized (this) block. This PR replaces the single FrequencyTrackingRingBuffer field with 16 independent ring buffers, partitioned by hash code.
singleThread_onUsesingleThread_shouldCacheconcurrent_uniform_4tconcurrent_uniform_8tconcurrent_uniform_16tconcurrent_uniform_32tconcurrent_mixed_zipf_16tconcurrent_mixed_zipf_32t