RFR 8005698 : Handle Frequent HashMap Collisions with Balanced Trees

Doug Lea dl at cs.oswego.edu
Sun May 26 12:46:47 UTC 2013


On 05/26/13 08:08, Peter Levart wrote:
> Clever idea. So your common TreeNode would extend LinkedHashMap.Entry.

Right. (Or renamings/refactorings of these).
And that begets other improvements in part by guaranteeing root
is first node of bin, so doesn't need TreeBins (which I cannot do in
CHM because links are pinned.) So far, I haven't gotten
this to the point of realistically comparing performance etc,
and wasn't going to post until I did, but then figured I'd
save you some effort.

>>
>> Another alternative that arises each time deep HashMap
>> surgery is contemplated is that you can almost completely ignore the
>> HashMap implementation inside LinkedHashMap, which is
>> likely to speed both up at the price of more code.

It might be close. There's a bunch of code in HashMap that exists
solely to support LinkedhashMap hooks, that would go away.

-Doug




More information about the core-libs-dev mailing list