HashMap with 8 million entries becomes slow

Viewed 3930

I have a HashMap with 8 million Point2D's mapping to a LinkedList.

private Map<Point2D,LinkedList<RoadEdge>> adjacencyList;

Everything works as it should, but it takes very long time for me to get data from the HashMap. Is there any alternative, that I can use to optimize getting data out?

I am willing to compromise the time it takes to put() in favor of the time it takes to get().

3 Answers
Related