You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2022/10/15 16:05:25 UTC
[lucene] branch main updated: Fix ExitableDirectoryReader sampling constants to be power-of-2 (#11850)
This is an automated email from the ASF dual-hosted git repository.
rmuir pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git
The following commit(s) were added to refs/heads/main by this push:
new ece8ea715cd Fix ExitableDirectoryReader sampling constants to be power-of-2 (#11850)
ece8ea715cd is described below
commit ece8ea715cdab0f304994405a5d31d30715935cb
Author: Robert Muir <rm...@apache.org>
AuthorDate: Sat Oct 15 12:05:15 2022 -0400
Fix ExitableDirectoryReader sampling constants to be power-of-2 (#11850)
If it's performance sensitive enough that we should do sampling, then we should avoid integer division too.
---
.../src/java/org/apache/lucene/index/ExitableDirectoryReader.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lucene/core/src/java/org/apache/lucene/index/ExitableDirectoryReader.java b/lucene/core/src/java/org/apache/lucene/index/ExitableDirectoryReader.java
index 4f8d2ae61d3..8bb1e449f47 100644
--- a/lucene/core/src/java/org/apache/lucene/index/ExitableDirectoryReader.java
+++ b/lucene/core/src/java/org/apache/lucene/index/ExitableDirectoryReader.java
@@ -347,7 +347,7 @@ public class ExitableDirectoryReader extends FilterDirectoryReader {
Bits timeoutCheckingAcceptDocs =
new Bits() {
- private static final int MAX_CALLS_BEFORE_QUERY_TIMEOUT_CHECK = 10;
+ private static final int MAX_CALLS_BEFORE_QUERY_TIMEOUT_CHECK = 16;
private int calls;
@Override
@@ -537,7 +537,7 @@ public class ExitableDirectoryReader extends FilterDirectoryReader {
private static class ExitablePointTree implements PointValues.PointTree {
- private static final int MAX_CALLS_BEFORE_QUERY_TIMEOUT_CHECK = 10;
+ private static final int MAX_CALLS_BEFORE_QUERY_TIMEOUT_CHECK = 16;
private final PointValues pointValues;
private final PointValues.PointTree in;
@@ -634,7 +634,7 @@ public class ExitableDirectoryReader extends FilterDirectoryReader {
private static class ExitableIntersectVisitor implements PointValues.IntersectVisitor {
- private static final int MAX_CALLS_BEFORE_QUERY_TIMEOUT_CHECK = 10;
+ private static final int MAX_CALLS_BEFORE_QUERY_TIMEOUT_CHECK = 16;
private PointValues.IntersectVisitor in;
private final QueryTimeout queryTimeout;