hey peter,

On Thu, Jan 12, 2012 at 4:10 PM, Peter K <[email protected]> wrote:
> Hi,
>
> questions regarding ThreadAffinityDocumentsWriterThreadPool:
>
> 1. Would someone explain to me the ThreadAffinityDocumentsWriterThreadPool
> class? E.g. why couldn't I use a ThreadLocal (I'll get exceptions)? Also
> what does the TODO mean?

ThreadAffinityDocumentsWriterThreadPool tries to select the least
contended DocumentsWriterPerThread for the incoming thread and if
possible assigns the same DWPT to the thread if the associated
(previously selected) DWPT is not contended.

The TODO is there since there could be a selection which is not ideal
if two threads are racing but it won't cause any exceptions etc.

does that make sense?
>
> 2. When profiling I see that "threadBindings.get" uses a quite a bit of my
> CPU - when using a trove collection* indexing gets a bit faster (~10%). But
> this test was only for one thread and yes, I know that TLongObjectHashMap is
> not thread safe. But probably worth a try in general to somehow improve the
> "threadBindings.get" performance?

you must be indexing very very small documents with very low number of
unique terms that you see issues with this class. I can't imagine that
the indexing process is dominated by this class. you can just try to
use an impl that doesn't use the threadBinding map at all. that should
work just fine though.

one more thing, if replacing the test gives you 10% indexing perf what
the hack are yo indexing? Is that the test you send the other day to
the user list like 900k docs in 29 sec or something like that?

simon
>
>
> Regards,
> Peter.
>
> *
> http://trove.starlight-systems.com/

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

Reply via email to