lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <>
Subject Re: Uneffective writeBytes and readBytes [FIX]
Date Thu, 08 Sep 2005 22:34:12 GMT
Paul Elschot wrote:
> I suppose one of these cases are when many terms are used in a query. 
> Would it be easily possible to make the buffer size for a term iterator
> depend on the numbers of documents to be iterated?
> Many terms only occur in a few documents, so this could be a 
> nice win on total buffer size for the many terms case.

This would not be too difficult.

Look in  The buffer may be allocated when the 
parent's stream is first cloned, but clone() won't allocate a buffer if 
the source hasn't had a buffer allocated yet, and nothing should perform 
i/o directly on the parent's freqStream, so in practice a buffer should 
not be allocated until the first read is performed on the clone.

So one could add an BufferedIndexInput.setBufferSize() method and then 
call it in, when the df is known and a 
buffer has not yet been allocated.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message