On Fri, Apr 24, 2009 at 6:20 PM, eks dev <eks...@yahoo.co.uk> wrote: > just do not forget to use -1 < doc instead of -1 != doc
Perhaps doc >=0 instead of doc != -1? The crux of it is that status flags (result positive, negative, or zero) are set by many operations - hence a compare/test operation can often be eliminated. For this same reason, counting down to zero in a loop instead of counting up to a limit can be slightly faster. It's a single cycle though.... normally not much to worry about :-) Of course, now we have processors like the i7 with macro-ops fusion that can take a TEST/CMP followed by a branch and fuse it into a single operation.... may level the field again. -Yonik http://www.lucidimagination.com --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org For additional commands, e-mail: java-dev-h...@lucene.apache.org