lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Wang <john.w...@gmail.com>
Subject Re: multi-threaded thru-put in lucene
Date Thu, 06 Jan 2005 19:13:51 GMT
Thanks Doug! You are right, by adding a Thread.sleep() helped greatly.

Mysteries of Java...

Another Java threading question.
With 1 thread, iterations of 100 searches, it took about 850 ms.
by adding a Thread.sleep(10) in the loop. It is taking about 2200 ms.

So there is 2200 - 1850 = 350 ms unaccounted for. Is that due to
thread scheduling/context switching?

Thanks

-John


On Thu, 6 Jan 2005 10:36:12 -0800, John Wang <john.wang@gmail.com> wrote:
> Is the operation IndexSearcher.search I/O or CPU bound if I am doing
> 100's of searches on the same query?
> 
> Thanks
> 
> -John
> 
> 
> On Thu, 06 Jan 2005 10:31:49 -0800, Doug Cutting <cutting@apache.org> wrote:
> > John Wang wrote:
> > > 1 thread: 445 ms.
> > > 2 threads: 870 ms.
> > > 5 threads: 2200 ms.
> > >
> > > Pretty much the same numbers you'd get if you are running them sequentially.
> > >
> > > Any ideas? Am I doing something wrong?
> >
> > If you're performing compute-bound work on a single-processor machine
> > then threading should give you no better performance than sequential,
> > perhaps a bit worse.  If you're performing io-bound work on a
> > single-disk machine then threading should again provide no improvement.
> >   If the task is evenly compute and i/o bound then you could achieve at
> > best a 2x speedup on a single CPU system with a single disk.
> >
> > If you're compute-bound on an N-CPU system then threading should
> > optimally be able to provide a factor of N speedup.
> >
> > Java's scheduling of compute-bound theads when no threads call
> > Thread.sleep() can also be very unfair.
> >
> > Doug
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message