Otis Gospodnetic wrote:

For the Lucene book I wrote some test cases that compare FSDirectory
and RAMDirectory. What I found was that with certain settings
FSDirectory was almost as fast as RAMDirectory. Personally, I would
push FSDirectory and hope that the OS and the Filesystem do their share
of work and caching for me before looking for ways to optimize my code.

Yes... I performed the same benchmark and in my situation RAMDirectory for searches was about 2% slower.

I'm willing to bet that it has to do with the fact that its a Hashtable and not a HashMap (which isn't synchronized).

Also adding a constructor for the term size could make loading a RAMDirectory faster since you could prevent rehash.

If you're on a modern machine your filesystme cache will end up buffering your disk anyway which I'm sure was happening in my situation.



Use Rojo (RSS/Atom aggregator). Visit http://rojo.com. Ask me for an invite! Also see irc.freenode.net #rojo if you want to chat.

Rojo is Hiring! - http://www.rojonetworks.com/JobsAtRojo.html

If you're interested in RSS, Weblogs, Social Networking, etc... then you should work for Rojo! If you recommend someone and we hire them you'll get a free iPod!
Kevin A. Burton, Location - San Francisco, CA
AIM/YIM - sfburtonator, Web - http://peerfear.org/
GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412

--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to