HashMap Profiling

Are there any HashMap implementations that expose hook methods for profiling Map performance (average chain length, best / worst / average access time, #rehashes, etc.).

It seems like using HashMap and “hoping for the best” regarding O (1) access time is pretty common without analyzing if this is true, but I would like to measure performance at runtime (at least during development), that's why that hooks with JMX or profiling software will also be good.

Also, does anyone know about HashMap implementations where chains are based on binary trees instead of linked lists?

Thanks in advance.

+5
source share
3 answers

There is a new Java profiler that somehow fits what you need. CollectionSpy ( www.collectionspy.com ) tracks the number of internal repetitions of any hash container, and also has a graph visualization of the length of the bucket list. It does not provide time information yet.

+4
source

In the second part of your question, if you are looking for a quick implementation of Hashmap with some decent real-time guarantees, take a look at Javolution . It is fast, reliable and goes to a decent amount of performance detail.

+2
source

TreeMap - .

: HashMaps, .

+1

All Articles