<i18n dev> RFR: 8372460: Use EnumMap instead of HashMap for DateTimeFormatter parsing to improve performance [v7]

Shaojin Wen swen at openjdk.org
Sun Dec 21 03:11:58 UTC 2025


On Sat, 20 Dec 2025 21:30:32 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

> This PR has been through too many incremental changes. I suspect a better solution is to implement a fit-for-purpose Map, optimized for ChronoFields but taking into account the possibility of unknown TemporalFields. All within the implementation of a Map<TemporalField, Long>. I'd like to see this PR closed and take a fresh look with all that is learned by the attempt.

I believe that tasks that can be performed during the build process should not be done during the parse process.

The process of building a DateTimeBuilder is executed once, while the parsing process is executed N times.

For example, a pattern like `yyyy-MM-dd HH:mm:ss.SSS` requires calling the `put` method of the Map 7 times during the parsing process.

Therefore, I think we should check whether chronoFieldOnly is used in DateTimeFormatterBuilder.

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

PR Comment: https://git.openjdk.org/jdk/pull/28471#issuecomment-3678397639


More information about the i18n-dev mailing list