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

Reply via email to