lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cheng <zhoucheng2...@gmail.com>
Subject Re: Seem contradictive -- indexwriter in handling multiple threads
Date Wed, 11 Jan 2012 20:29:49 GMT
Will do if I see a perf gain.

The other issue is that in each thread my apps will not only do indexing
but searching. That means I will have to pass through the ram directory
instance, along with the writer instance, to every thread so that the
searcher can be built on.

Should I create a same reader and a same searcher and pass them through
every thread too?



On Wed, Jan 11, 2012 at 3:21 PM, Michael McCandless <
lucene@mikemccandless.com> wrote:

> Yes that would work fine.... but you should see a net perf loss by
> doing so (once you include time to flush/sync the RAMDir to an FSDir).
>
> If you see a perf gain then please report back!
>
> Mike McCandless
>
> http://blog.mikemccandless.com
>
> On Wed, Jan 11, 2012 at 3:09 PM, Cheng <zhoucheng2008@gmail.com> wrote:
> > Can I create a RAMDirectory based writer and have it work cross all
> > threads? In the sense, I would like to use RAMDirectory every where and
> > have the RAMDirectory written to FSDirectory in the end.
> >
> > I suppose that should work, right?
> >
> >
> > On Wed, Jan 11, 2012 at 2:31 PM, Michael McCandless <
> > lucene@mikemccandless.com> wrote:
> >
> >> On Wed, Jan 11, 2012 at 1:32 PM, dyzc2010 <zhoucheng2008@gmail.com>
> wrote:
> >>
> >> > Mike, do you mean if I create a FSDirectory based writer in first
> place,
> >> then the writer should be used in every thread rather than create a new
> >> RAMDirectory based writer in that thread?
> >>
> >> Right.
> >>
> >> > What about I do want to use RAMDirectory to speed up the index and
> >> search processes?
> >>
> >> IndexWriter is very efficient in using RAM across multiple threads
> >> now... so this isn't worth it at indexing time.
> >>
> >> At search time... MMapDirectory is a good way to let the OS use
> >> currently free RAM for caching.
> >>
> >> Mike McCandless
> >>
> >> http://blog.mikemccandless.com
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> >> For additional commands, e-mail: java-user-help@lucene.apache.org
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message