I meant exactly what I said. My opinion is that Instantiated puts more strain on GC compared to RAMDir. If that aspect is negligible for you (less docs, smaller heap) it quite probably runs faster, if not - after some point GC costs will dwarf any gains.
2010/8/26 Li Li <[email protected]>: > do you mean that InstantiatedIndex is not as fast as its document says? > > 2010/8/26 Earwin Burrfoot <[email protected]>: >> IMHO, Instantiated sucks GC-wise. Put more docs in it, do enough >> queries, and RAMDir eventually outperforms it. >> >> On Thu, Aug 26, 2010 at 11:24, Li Li <[email protected]> wrote: >>> I have about 70k document, the total indexed size is about 15MB(the >>> orginal text files' size). >>> dir=new RAMDirectory(); >>> IndexWriter write=new IndexWriter(dir,...; >>> for(loop){ >>> writer.addDocument(doc); >>> } >>> writer.optimize(); >>> writer.close(); >>> >>> IndexReader ir=IndexReader.open(dir,true); >>> InstantiatedIndex ii=new InstantiatedIndex(ir); >>> InstantiatedIndexReader iir=new InstantiatedIndexReader(ii); >>> is=new IndexSearcher(ir); >>> is2=new IndexSearcher(iir); >>> >>> I calculate the time by: >>> long searchStart=System.nanoTime(); >>> TopDocs docs=is.search(bQuery,Integer.MAX_VALUE); >>> long searchEnd=System.nanoTime(); >>> >>> I searched 10,000 documents and the time of RAMDirectory >>> and instantiated >>> the time used is time1: 21s(21812978000 ns) time2: >>> 20s(20713817000 ns) >>> I also calulate the time including get field value: >>> total1: 23852ms total2: 22610ms >>> it seems instantiated is not much faster than >>> RAMDirectory. Is there any thing wrong I used? my max memory is 4GB >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [email protected] >>> For additional commands, e-mail: [email protected] >>> >>> >> >> >> >> -- >> Kirill Zakharenko/Кирилл Захаренко ([email protected]) >> Phone: +7 (495) 683-567-4 >> ICQ: 104465785 >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Kirill Zakharenko/Кирилл Захаренко ([email protected]) Phone: +7 (495) 683-567-4 ICQ: 104465785 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
