lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mohsen Saboorian <mohs...@gmail.com>
Subject Re: Doesn it make sense cache IndexReader?
Date Thu, 17 Jul 2008 15:49:18 GMT

Kastern, thanks for the reply.

> IndexReader is thread-save so you don't need a cache.

If it wasn't thread-safe I may need a cache? I think the cache cannot be
used on a non-thread-safe environment since it exposes same instances to
different threads.

> Opening and closing an IndexReader takes some time. But I don't
> now if this is measurable.
> So if you know that you don't want to change a index, let the IndexReader
> open.
> (somebody disagree with me?)

My indices are readonly. Once created never change. If the memory footprint
for an open IndexReader is very low, I can keep all the gradually opened
index readers open.

> If you want to use your main memory you can switch from FSDirectory to
> RamDirectory.
> This will boost your performance for sure.

Thanks for the suggestion. I will use it for the most commonly used index.

Mohsen.
-- 
View this message in context: http://www.nabble.com/Doesn-it-make-sense-cache-IndexReader--tp18502361p18511667.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message