-
Notifications
You must be signed in to change notification settings - Fork 779
consider reusing IndexSearcher objects #1132
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
Comments
FWIW |
The proof of concept code shaved thousands of syscalls to mere hundreds. I don't have the performance numbers handy but it feels definitely faster. |
Note-to-self: the key for good testing coverage is to also perform couple of back-to-back negative searches as they trigger suggestions which also use IndexReaders (and close it in the end). |
nice so they can get reused eventually? |
That's the whole point. |
lovely :) |
Performed some performance measurements. The file system cache was warmed beforehands with Before (0.13rc1): After: Obviously, the first search 'after' had to mmap/open all index files so it took longer. After that the object reuse is visible. In total, the average search times (2104 vs. 1170 miliseconds) make it even more clear that the performance win is substantial (i.e. almost 2 times faster). |
The question is what happens with a search request during reindex if the index files change while the mappings are still established. This could be happening before this change, just not on the same scale. |
This should be fine as each reindex creates new files (e.g. I wonder if this behavior is given by these 2 lines in
and whether it is desired or not for this use case. |
I asked on the Lucene java-users mailing list and Uwe Schindler responded:
|
IndexReader has a method which should save the reopen/mmap on every search request: More on this from Uwe:
|
Uh oh!
There was an error while loading. Please reload this page.
In issue #1116 there was a suggestion to find out if the initial part of
searchMultiDatabase()
whereFSDirectory.open
is called andMultiReader
is instantiated could be called just once / after each reindex. For webapp, the place for potential modification isSearchHelper#prepareExec()
.If this is doable, this should speed up multi-project searches with high number of projects significantly (assuming file system cache is warmed up).
The text was updated successfully, but these errors were encountered: