-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Catch up DLS with recent Lucene changes. #133966
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
Conversation
Lucene introduced the `Bits#applyMask` API to speed up the evaluation of non-scoring queries (e.g. aggregations-only queries) and is considering making `BitSet` a sealed class that only allows `FixedBitSet` and `SparseFixedBitSet` as sub-classes to control the performance impact of virtual calls. As a consequence, this change: - renames `CombinedBitSet` to `CombinedBits`, - makes it implement `Bits` instead of extending `BitSet`, - implements `CombinedBits#applyMask`, - refactors how the query and live docs are intersected in `ContextIndexSearcher`.
|
Pinging @elastic/es-security (Team:Security) |
|
Ping @joegallo, FYI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (I think I understood it all)
| bitSet.clear(to - from, bitSet.length()); | ||
| } else { | ||
| to = from + WINDOW_SIZE; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we use a mix of WINDOW_SIZE and bitSet.length() ?
They should be the same, and it looks like the code relies on them being the same, but perhaps you had a deeper for reason mixing them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No reason! Let me use WINDOW_SIZE everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
I updated my previous benchmark for testing DLS to account for these changes. Specifically, #120627 mentions Looking at the flamegraphs, the speed up is pretty clear:
The time spent in any In terms of the overall speed up, here's what means for the high level operation of running a search via a DLS role that hits an index for which there are deleted documents: If you compare the main versus this-pr case, you'll notice that there's a modest but real improvement (a few percent, in this benchmark) in both throughput and latency for both the cache-constrained and non cache-constrained cases. |


Lucene introduced the
Bits#applyMaskAPI to speed up the evaluation of non-scoring queries (e.g. aggregations-only queries) and is considering makingBitSeta sealed class that only allowsFixedBitSetandSparseFixedBitSetas sub-classes to control the performance impact of virtual calls.As a consequence, this change:
CombinedBitSettoCombinedBits,Bitsinstead of extendingBitSet,CombinedBits#applyMask,ContextIndexSearcher.Closes #120627