Hi,

It depends on the Lucene version, so if the test uses latest Lucene on a
64bit OS, it may use MMapDirectory internally (returned on
FSDirectors.open()) - then its comparing the same with the same - reading
from ram memory :-)

Maybe the difference is also caused by not warming hotspot's compiler. Those
times are only ok, if you repeat the same code path quite often and only use
the recent results and not the ones from the first iterations 8AS Java's
hotspot is still optimizing).

We did not got any information about how these numbers were measured.

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: u...@thetaphi.de


> -----Original Message-----
> From: Michael McCandless [mailto:luc...@mikemccandless.com]
> Sent: Monday, June 06, 2011 5:58 PM
> To: java-user@lucene.apache.org
> Subject: Re: RAMDirectory doesn't win over FSDirectory all the time, why?
> 
> This test is very old (from the 1st edition of the book but removed from
the
> 2nd).
> 
> Modern OS's cache newly written files in RAM, and this test doesn't write
> very large files (I think?), so the test is really testing an OS's IO
cache vs
> Lucene's RAM Dir.
> 
> That said, I'm not sure why RAMDir would be slower... FSDir still must go
> through the OS APIs even if the OS then caches in RAM.
> 
> Mike McCandless
> 
> http://blog.mikemccandless.com
> 
> 2011/6/6 zhoucheng2008 <zhoucheng2...@gmail.com>:
> > I read the lucene in action book and just tested the
> > FSversusRAMDirectoryTest.java with the following uncommented:
> >
> >
> >
> >    //    /**
> >
> >    //    // change to adjust performance of indexing with FSDirectory
> >
> >        writer.mergeFactor = 100;
> >
> >        writer.maxMergeDocs = 999999;
> >
> >        writer.minMergeDocs = 1000;
> >
> > //    */
> >
> >
> >
> > Here is the output:
> >
> > RAMDirectory Time: 805 ms
> >
> > FSDirectory Time : 728 ms
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
> For additional commands, e-mail: java-user-h...@lucene.apache.org



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

Reply via email to