Add inter-query concurrency for knnPerfTest.py#509
Add inter-query concurrency for knnPerfTest.py#509abernardi597 wants to merge 4 commits intomikemccand:mainfrom
Conversation
mikemccand
left a comment
There was a problem hiding this comment.
Thanks @abernardi597! Sorry for the long delay ...
I left a bunch of comments. Net/net I like the change, and this is a badly needed feature, but can we find a way to not add the two new allocations (buffers/arrays) for every doc we index? I think today we reuse a single byte[] or float[] array and ByteBuffer. I like to brutally minimize any "outside of Lucene" cost so that we (as best we can) measure specifically Lucene's cost. I like that the generics for VectorReader simplified some code, but I don't like the added cost, spook methods like interpret, etc. ;)
I also suggested possible names (the hardest part) -- -numSearchThread and -numQueryThread seem like synonyms to me (searching vs querying).
I think we lost some prior code / checks (like vector files containing exactly whole vectors); I tried to catch & add comments but please double check on the deleted/refactored code that it didn't functionally lose something? Or if it's on purpose, just call it out / explain a bit.
Finally, using Java's nice async APIs ... I don't think that's really buying us much here (Lucene's internal IO itself isn't async-aware yet, I think?), and maybe losing things (prompt reporting of clear exception, and exit(1), promptly, if a query fails).
src/main/knn/KnnGraphTester.java
Outdated
| } | ||
| break; | ||
| case "-numQueryThread": | ||
| // 0: single thread mode (not passing a executorService) |
There was a problem hiding this comment.
Is this in -help or so as well? Or javadocs?
There was a problem hiding this comment.
I added it to the exception for misusing the flag, but not explicitly anywhere else.
There was a problem hiding this comment.
Hmm is there no -help or so existing now?
|
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! |
5f29793 to
7ce8cba
Compare
3ebf955 to
8edb9e0
Compare
8edb9e0 to
9649074
Compare
9649074 to
e83767a
Compare
I implemented inter-query concurrency by adding a new thread pool for dispatching queries to the
IndexSearcher.To do so, I made the
VectorReaderuse random reads on itsFileChannelto make the object thread-safe.There are some other small refactors as well.
Closes #505.