-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Avoid object construction when linear searching arcs #12692
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
|
Result on wikimediumall (nothing changed obviously) : |
| if (flag(flags, BIT_ARC_HAS_FINAL_OUTPUT)) { | ||
| outputs.skipFinalOutput(in); | ||
| } | ||
| if (!flag(flags, BIT_STOP_NODE) && !flag(flags, BIT_TARGET_NEXT)) { |
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.
Could we use == false instead? This more readable form reduces the chance of accidental future refactoring bugs.
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.
Thanks @mikemccand , this pattern is copied from seekToNextNode, i refactored it too.
mikemccand
left a comment
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.
I like this change! Rather than fully decoding each outgoing arc, we only decode the "metadata", enough to check whether the label matches, in the fallback case when we must linearly scan the arcs. I left one small comment about final and non-final outputs ...
…ache.org * upstream/main: (239 commits) Bound the RAM used by the NodeHash (sharing common suffixes) during FST compilation (apache#12633) Fix index out of bounds when writing FST to different metaOut (apache#12697) (apache#12698) Avoid object construction when linear searching arcs (apache#12692) chore: update the Javadoc example in Analyzer (apache#12693) coorect position on entry in CHANGES.txt Refactor ByteBlockPool so it is just a "shift/mask big array" (apache#12625) Extract the hnsw graph merging from being part of the vector writer (apache#12657) Specialize `BlockImpactsDocsEnum#nextDoc()`. (apache#12670) Speed up TestIndexOrDocValuesQuery. (apache#12672) Remove over-counting of deleted terms (apache#12586) Use MergeSorter in StableStringSorter (apache#12652) Use radix sort to speed up the sorting of terms in TermInSetQuery (apache#12587) Add timeouts to github jobs. Estimates taken from empirical run times (actions history), with a generous buffer added. (apache#12687) Optimize OnHeapHnswGraph's data structure (apache#12651) Add createClassLoader to replicator permissions (block specific to jacoco). (apache#12684) Move changes entry before backporting CHANGES Move testing properties to provider class (no classloading deadlock possible) and fallback to default provider in non-test mode simple cleanups to vector code (apache#12680) Better detect vector module in non-default setups (e.g., custom module layers) (apache#12677) ...
|
Nightly benchmark shows fuzzy queries are a bit happy for this change: https://home.apache.org/~mikemccand/lucenebench/2023.10.19.18.03.18.html. |
Description
This PR resolves a todo left in
FSTthat we construct some useless objects during linear search. This is also an effort that tries to avoidOutputs#readas we have more outputs distributed in arcs with MSB VLong format.I'll run luceneutil soon.
See also #12661