lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Friedman <pfried...@macromedia.com>
Subject Strange behavior indexing 1000 documents in RAMDirectory
Date Fri, 09 Nov 2001 22:26:32 GMT
While comparing RAMDirectory vs FSDirectory indexing performance I ran across some strange
behavior.  If I try to add 1000 documents using the RAMDirectory and then write it to disk,
the search fails to find any documents.  However, running the exact same test with any other
number of documents seems to work fine.

I have attached a test case that attempts to add/search 500, 999, 1000, 1001, 2000, 5000 documents
to both a RAMDirectory and FSDirectory and then searches for the documents.  Notice in the
following test output that the RAMDirectory test using 1000 documents fails to find any documents,
all other tests work fine.

D:\Dev\Test Tools\lucene>java -cp %CLASSPATH%;.\ RAMWriterTest

Index and search 500 documents
RAMDirectory: indexed 500 in 1656 msec
RAMDirectory indexing: search 500 in 125 msec
FSDirectory: indexed 500 in 4157 msec
FSDirectory indexing: search 500 in 78 msec

Index and search 999 documents
RAMDirectory: indexed 999 in 1953 msec
RAMDirectory indexing: search 999 in 31 msec
FSDirectory: indexed 999 in 7797 msec
FSDirectory indexing: search 999 in 235 msec

Index and search 1000 documents
RAMDirectory: indexed 1000 in 1891 msec
RAMDirectory indexing: search 0 in 15 msec
FSDirectory: indexed 1000 in 8485 msec
FSDirectory indexing: search 1000 in 31 msec

Index and search 1001 documents
RAMDirectory: indexed 1001 in 1797 msec
RAMDirectory indexing: search 1001 in 16 msec
FSDirectory: indexed 1001 in 8484 msec
FSDirectory indexing: search 1001 in 32 msec

Index and search 2000 documents
RAMDirectory: indexed 2000 in 3594 msec
RAMDirectory indexing: search 2000 in 16 msec
FSDirectory: indexed 2000 in 16875 msec
FSDirectory indexing: search 2000 in 31 msec

Index and search 5000 documents
RAMDirectory: indexed 5000 in 8641 msec
RAMDirectory indexing: search 5000 in 31 msec
FSDirectory: indexed 5000 in 42375 msec
FSDirectory indexing: search 5000 in 78 msec


Can anybody explain this?

Thanks.
Paul


Mime
View raw message