fudongyingluck commented on PR #12339: URL: https://github.com/apache/lucene/pull/12339#issuecomment-1583936303
> No computing the number of deletes twice makes sense to me. What I'm not super happy about is that it's a bit trappy for merge policies, they need to be very careful to call the right methods to not compute it twice. E.g. I believe that `LogMergePolicy` needs a similar fix to the one that you made to `TieredMergePolicy`. > > As a potential alternative, I wonder if `IndexWriter` could use a wrapper around the `MergeContext` which would memoize the number of deletes of every `SegmentCommitInfo` in a hash map when calling the merge policy. This way, if you happen to call `numDeletesToMerge` twice on the same `SegmentCommitInfo`, the second one would be served from the cache? -- 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: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org