lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yonghui Zhao <zhaoyong...@gmail.com>
Subject strange performance diff
Date Fri, 10 Nov 2017 14:18:35 GMT
Hi,

I use the code below to test same query on same index in one time.


long t0 = System.currentTimeMillis();
indexSearcher.search(query, from + size);
long t1 = System.currentTimeMillis();
LOGGER.info("indexSearcher.search(query, from + size) took:" + (t1 -
t0) + "ms");
TopScoreDocCollector collector = TopScoreDocCollector.create(from +
size, null, true);
indexSearcher.search(query, collector);
long t2 = System.currentTimeMillis();
LOGGER.info("TopScoreDocCollector took:" + (t2 - t1) + "ms");


The query is a simple long boolean query such like "title:(a strange perf
test....)".
The index is 13M docs.
Lucene version is 4.10.4.
No parallel search enabled, i.e.  ExectutorService is null in IndexSearcher

The first case is direct search, the second is use TopScoreDocCollector
which is indeed inner implementation of direct search.


I test many times, the result is very stable the first case result is about
300ms, the second is about 600ms.

I am wondering where is the difference from.

Anyone can give a hint?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message