Le 5/11/13 8:54 PM, Julien Vermillard a écrit :
> i made a (very) dumb micro bench, if you access the structure from
> always the same thread : so it never lock the ConcurentHashMap version
> is quite faster :
>
> https://gist.github.com/jvermillard/5560969
>
> for accessing 1000000000 entries :
> time : 22396 ms for hash map + read/write lock
> time : 8034 ms for concurrent hash map

I would notbet too much on those results ;-)...

But I think it's a better idea to use a ConcurrentHashMap
OTOH, be sure to use the appropriate concurrencyLevel (default is 16,
which is way too high in most of the case). I would initialize the
ConcurrentHashMap with a concurrencyLevel equal to the number of threads
used to process the incoming data.

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 

Reply via email to