prudhvigodithi commented on PR #17027:
URL: https://github.com/apache/lucene/pull/17027#issuecomment-6932626630

   Some numbers for this change, measured locally:
   
   Setup:
   - One segment, one keyword field with 1M or 10M distinct terms, default 
codec.
   - Query: `WildcardQuery("*zzz_no_match")`. It matches nothing, so it scans 
the whole terms dictionary.
   - The reader is wrapped with `ExitableDirectoryReader.wrap(reader, 
queryTimeout)`.
   - Cancel and timeout are both passed as a `QueryTimeout`. A cancel is a 
`QueryTimeout` whose `shouldExit()` returns a flag that another thread sets. A 
timeout is one whose `shouldExit()` checks the clock, e.g. `QueryTimeoutImpl`. 
This change handles both the same way.
   - JDK 25, 4-core / 8-thread Xeon.
   
   **After a cancel**
   
   8 queries run at the same time, and their cancel flag is set at 10% of a 
full scan. Two things are measured: how much CPU each query keeps using after 
the cancel, and how long it takes until all of them have actually stopped.
   
   CPU each query used after it was cancelled:
   
   | Terms | Without this change | With this change |
   |---|---|---|
   | 1M | 46.7 ms | 0.13 ms |
   | 10M | 653 ms | 0.07 ms |
   
   Time from the cancel until the last of the 8 queries stopped:
   
   | Terms | Without this change | With this change |
   |---|---|---|
   | 1M | 78 ms | 0.3 ms |
   | 10M | 1,163 ms | 0.2 ms |
   
   Without this change the cancel is ignored and each query runs its full scan. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to