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 2021/12/07 03:24:58 UTC
[lucene] branch branch_9x updated: speed up TestSimpleExplanationsWithFillerDocs (#516)
This is an automated email from the ASF dual-hosted git repository.
rmuir pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git
The following commit(s) were added to refs/heads/branch_9x by this push:
new 4d48dc8 speed up TestSimpleExplanationsWithFillerDocs (#516)
4d48dc8 is described below
commit 4d48dc87f7a19cfe612ef3aee9585366043a76a8
Author: Robert Muir <rm...@apache.org>
AuthorDate: Mon Dec 6 22:12:36 2021 -0500
speed up TestSimpleExplanationsWithFillerDocs (#516)
This is the slowest test suite, runs for ~ 60s, because between every
document it adds 2048 "filler docs". This just adds up to a ton of
indexing across all the test methods.
Use 2048 for Nightly, and instead a smaller number (4) for local builds.
---
.../apache/lucene/search/TestSimpleExplanationsWithFillerDocs.java | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSimpleExplanationsWithFillerDocs.java b/lucene/core/src/test/org/apache/lucene/search/TestSimpleExplanationsWithFillerDocs.java
index 4b98ea7..949c63b 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestSimpleExplanationsWithFillerDocs.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestSimpleExplanationsWithFillerDocs.java
@@ -21,7 +21,6 @@ import org.apache.lucene.document.Field;
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.index.Term;
import org.apache.lucene.util.ArrayUtil;
-import org.apache.lucene.util.LuceneTestCase.Slow;
import org.apache.lucene.util.TestUtil;
import org.junit.Assume;
import org.junit.BeforeClass;
@@ -32,12 +31,10 @@ import org.junit.BeforeClass;
* they will all use terms from same set of source data as our regular docs (to emphasis the DocFreq
* factor in scoring), in which case the queries will be wrapped so they can be excluded.
*/
-@Slow // can this be sped up to be non-slow? filler docs make it quite a bit slower and many test
-// methods...
public class TestSimpleExplanationsWithFillerDocs extends TestSimpleExplanations {
/** num of empty docs injected between every doc in the index */
- private static final int NUM_FILLER_DOCS = BooleanScorer.SIZE;
+ private static final int NUM_FILLER_DOCS = TEST_NIGHTLY ? BooleanScorer.SIZE : 4;
/** num of empty docs injected prior to the first doc in the (main) index */
private static int PRE_FILLER_DOCS;
/**