RFR: 8281631: HashMap.putAll can cause redundant space waste [v6]

XenoAmess duke at openjdk.java.net
Tue Feb 15 04:17:12 UTC 2022


On Tue, 15 Feb 2022 03:45:19 GMT, Stuart Marks <smarks at openjdk.org> wrote:

> > A test will fail if not change codes there. Every pr should pass ci, so I have no choice.
> 
> Hm, yes I recall in the preliminary email that there was some mention of a test. However, the test seemed to use the same (incorrect) calculation, so maybe the test needs to be fixed instead.

These changes in those 2 class already the minimal changes for passing ci, as that test itself seems meaningful so I don't wanna shut it down.

> Offhand, the HashMap/LinkedHashMap and the corresponding Set classes, and WeakHashMap, are the main places to look. IdentityHashMap and the Map.of() implementations use a different organization so are probably unrelated. ConcurrentHashMap is another obvious place; you might want to investigate there, but depending on the fix (if any) we might want to handle it separately. I'd search for "loadFactor" or "LOAD_FACTOR" and see if anything else turns up.

Thanks, I will start from there and see if can found something interesting.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7431


More information about the core-libs-dev mailing list