RFR: 8186958: Need method to create pre-sized HashMap [v12]

Stuart Marks smarks at openjdk.java.net
Sat Apr 9 02:51:36 UTC 2022


On Wed, 6 Apr 2022 16:02:31 GMT, XenoAmess <duke at openjdk.java.net> wrote:

>> 8186958: Need method to create pre-sized HashMap
>
> XenoAmess has updated the pull request incrementally with one additional commit since the last revision:
> 
>   use (double) DEFAULT_LOAD_FACTOR instead of 0.75

Regarding the scope of call sites in this PR: it's definitely worthwhile including call sites, particularly those that have errors! The issue with including a lot of call sites is that it potentially brings in a lot of additional reviewers. We should definitely include call sites in `java.base` as I'm sure we can get good review coverage for those. Others should be included on a case-by-case basis. Maybe we end up including them all, but maybe there are some cases that are questionable -- I'll have to look. We can adjust the labels based on what's the final set.

Note the mapping between files in the repo and applied labels is in

https://github.com/openjdk/skara/blob/master/config/mailinglist/rules/jdk.json

I don't know if there's a way to have these be reapplied automatically. We might have to do some manual pattern matching.

Regarding `@ForceInline` I don't think it's worth worrying about. Like the floating-point vs integer computation, the overhead of calling a method is likely to be quite small compared to the expense of populating the HashMap. The JIT will inline small methods according to its inline policy and heuristics, which I think we should be comfortable relying on.

Note: I still need a reviewer for the CSR: [JDK-8284377](https://bugs.openjdk.java.net/browse/JDK-8284377).

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

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


More information about the core-libs-dev mailing list