Hacker News new | ask | show | jobs
by cfieber 4965 days ago
It is kind of a dumb test to do 'new HashMap' with the default initialCapacity then cram stuff into it in a tight loop.

It is basically testing constant rehashes which is obviously going to generate a ton of garbage

I suspect the default collection implementations would perform significantly better if they were used correctly

1 comments

They still suck even if you set a large initialCapacity.