On Thu, Mar 1, 2012 at 11:55 AM, mark harwood <[email protected]> wrote:

> Based on your comments re the added int comparison cost in that "hot" loop it 
> made me think that the abstract docIdSetIterator.docId() method call could be 
> questioned on that basis too?
> It looks like all DocIdSetIterator subclasses maintain a doc variable mutated 
> elsewhere in advance() and next() calls and docID() is meant to be idempotent 
> so presumably a shared variable in the base class could avoid a docID() 
> method invocation?
> Anyhoo the profiler did not show that method up as any sort of hotspot so I 
> don't think it's an issue.

Maybe we could explore that?  I'm not sure about hotspot implications
though... (vs private int accessible only via getter).

Ideally, consumers of DISI should hold onto the int docID returned
from next/advance and use that... (ie, don't call docID() again,
unless it's too hard to hold onto the returned doc).

> Thanks, Mike.

Thank you!  Keep the ideas coming :)

Mike McCandless

http://blog.mikemccandless.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to