Repository navigation
Keep shared objects off the per-neighbor search path - #833
Merged
Merged
Conversation
searchOneLayer checks once per layer for accept-all filters and the no-op score tracker, and counts visits in the per-layer processor.
Contributor
|
Before you submit for review:
If you did not complete any of these, then please explain below. |
Shorten comments and add the 4.1.0-rc.2 performance note.
tlwillke
marked this pull request as ready for review
November 24, 2026 21:02
tlwillke
requested review from
MarkWolters,
ashkrisk,
dian-lun-lin,
jshook,
r-devulap and
vasimuddinmd
as code owners
November 24, 2026 21:02
MarkWolters
approved these changes
Nov 24, 2026
MarkWolters
left a comment
Contributor
There was a problem hiding this comment.
Just asking for a docs change, looks good otherwise
MarkWolters
approved these changes
Nov 24, 2026
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.
With several searchers running at once, some JVMs ran graph search 13–22% slower for their whole lifetime. The cause is false sharing. For every scored neighbor,
GraphSearcherread shared objects (Bits.ALLand the no-op score tracker) and wrote its ownvisitedCount. After heap compaction, one worker's searcher could end up on the same cache line as a shared object. Its writes then kept pulling that line away from the other cores.searchOneLayernow checks once per layer whether the filter accepts everything and whether the tracker is the no-op one, so the per-neighbor path no longer touches shared objects. Visits are counted in the per-layer processor and added tovisitedCountonce per layer. Results and visit counts are unchanged.Results
Setup:
Every JVM visited the same number of nodes per query (508.3).
The slow mode is intermittent and appears less often on current
main. These runs therefore compare commit 8863c5a with and without the change, where it shows up more readily. Among JVMs that did not go slow, the change was about 0.7% lower, which is close to the noise.Tests:
jvector-testspasses on Ice Lake (8 cores), 131 tests.