1. Create a tool class jdk.internal.util.DateTimeHelper, move the formatTo method of LocalDateTime/LocalDate/LocalTime to it, so that these methods can be used across packages within JDK, so that StringBuilder can be shared, avoiding multiple creation of StringBuilder and toString.
2. Refactor DateTimeFormatterBuilder::format to use the jdk.internal.util.DateTimeHelper::formatTo method.
3. Split the DateTimeFormatterBuilder::format method, separate the currentEra and beforeCurrentEra sub-methods, so that codeSize < 325 can be inlined. Most scenarios call currentEra, so performance is improved.
2. Refactor DateTimeFormatterBuilder::format to use the jdk.internal.util.DateTimeHelper::formatTo method.
3. Split the DateTimeFormatterBuilder::format method, separate the currentEra and beforeCurrentEra sub-methods, so that codeSize < 325 can be inlined. Most scenarios call currentEra, so performance is improved.
- links to
-
Commit(master) openjdk/jdk/74420391
-
Review(master) openjdk/jdk/20353