RFR: 8281631: HashMap copy constructor and putAll can over-allocate table [v21]
XenoAmess
duke at openjdk.java.net
Wed Mar 2 18:42:10 UTC 2022
On Wed, 2 Mar 2022 01:44:24 GMT, Stuart Marks <smarks at openjdk.org> wrote:
> I'm starting to look at this again. First, a quick note -- I don't think there should be any IdentityHashMap changes here. That uses a completely different internal structure and allocation policy, and it's kind of a distraction from the main point of this change. (As the preceding chain of comments illustrates.)
>
> There is a question of whether IdentityHashMap ought to "allow for some growth" when copying a map, but it's hard to see how much of a problem this really is. I'd suggest focusing on getting this change done, and then (if you still have energy) to try to eradicate the `(int) (expected / 0.75) + 1` idiom that's sprinkled around the JDK.
OK, will split this part from this pr.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7431
More information about the core-libs-dev
mailing list