<i18n dev> RFR: 8349189: Speed up DateTime parse & format via Class File API [v11]

Alan Bateman alanb at openjdk.org
Thu Feb 6 15:01:28 UTC 2025


On Tue, 4 Feb 2025 13:39:28 GMT, Shaojin Wen <swen at openjdk.org> wrote:

>> By using the Class File API to dynamically generate a CompositePrinterParser, and defining DateTimePrinterParser[] printerParsers as a specific field, C2 can do TypeProfile optimization.
>> 
>> Since the CompositePrinterParser is generated based on the pattern, we can make the following optimizations:
>> 
>> 1. For example, for the parse and print of Month/DayOfMonth/Hour/Minute/Second with a fixed length of 2, do targeted parse and print optimization.
>> 
>> 2. Parse uses LocalDate/LocalTime/LocalDateTime/OffsetDateTime for TemporalQuery to avoid the overhead of constructing DateTimeParseContext.
>> 
>> These optimizations can significantly improve performance, with more than 100% performance improvement in many scenarios.
>
> Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   more use getInt & add more test

I've set the number of reviewers to at least 2 as there is a lot of complexity proposed here and one Reviewer will not be sufficient. Before spending any time on this, maintainers in this area will need to consider whether the complexity is worth it and whether resources should be taken from larger projects to review the proposed changes.

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

PR Comment: https://git.openjdk.org/jdk/pull/23384#issuecomment-2636511769


More information about the i18n-dev mailing list