[jdk17u-dev] RFR: 8304976: Optimize DateTimeFormatterBuilder.ZoneTextPrinterParser.getTree() [v2]
Oli Gillespie
ogillespie at openjdk.org
Fri Jun 2 09:55:07 UTC 2023
On Fri, 2 Jun 2023 09:48:50 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> It's not clear why 64 was chosen here. Reading https://bugs.openjdk.org/browse/JDK-8235238 I don't see anything which particularly justifies 64. On my system:
>>
>>
>> Set<String> regionIds = ZoneRulesProvider.getAvailableZoneIds();
>> Set<String> nonRegionIds = new HashSet<>();
>> for (String[] z : TimeZoneNameUtility.getZoneStrings(Locale.getDefault())) {
>> if (!regionIds.contains(z[0])) nonRegionIds.add(z[0]);
>> }
>> System.out.println(nonRegionIds.size());
>>
>>
>> gives 28, so it seems 64 already accounts for load factor nicely at least on my system.
>
> Right. Actually, scratch my comment, since the current version matches what mainline does.
While I'm happy you're happy, that's not quite right - mainline uses `HashSet.newHashSet(64)` which is equivalent to `new HashSet(128)`, but I don't think that was a justified change in mainline.
-------------
PR Review Comment: https://git.openjdk.org/jdk17u-dev/pull/1414#discussion_r1214168205
More information about the jdk-updates-dev
mailing list