lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From heritrix.lucene <heritrix.luc...@gmail.com>
Subject Re: Searching is taking a lot...
Date Fri, 30 Jun 2006 03:05:53 GMT
Ya you are correct. My idea will not work when there are lots of documents
in the index and also there are lots of hits for that page.
I am going with you.... :-)

Thanx...

On 6/29/06, James Pine <general_nogi@yahoo.com> wrote:
>
> Hey,
>
> I'm not a performance guru, but it seems to me that if
> you've got millions of results coming back then you
> probably don't want to call ArrayList.add() each time,
> as it will have to grow itself a bunch of times. Also,
> even ints take up space in memory, so if you only need
> 20 of them, then storing millions is pretty wasteful.
> As Paul suggested, using an int[] would be better, and
> pretty easy since you know the size it needs to be in
> advance i.e. resultsPerPage. If you're worried about
> the conditional taking up cpu cycles you could use the
> ternay operator which I believe is slightly more
> efficient.
>
> JAMES
>
> --- "heritrix.lucene" <heritrix.lucene@gmail.com>
> wrote:
>
> > This will break performance. It is better to first
> > collect all the document
> > > numbers (code without the proper declarations):
> > >
> > > public void collect(int id, float score) {
> > >      if(docCount >= startDoc && docCount < endDoc)
> > {
> > >          docNrs.add(id); // or use int[] docNrs
> > when possible.
> > >   ....
> >
> >
> > Why
> > public void collect(int id, float score) {
> >      if(docCount >= startDoc && docCount < endDoc) {
> > is requiered.
> >
> > i think the bertter thing is
> > public void collect(int id, float score) {
> >     docNrs.add(id); // or use int[] docNrs when
> > possible.
> > because anyhow the collect metod will be called
> > total number of matched
> > documents times.
> > why should we introfuce one more condition....
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> 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