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

Shaojin Wen swen at openjdk.org
Mon Feb 3 14:16:31 UTC 2025


> 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 two additional commits since the last revision:

 - revert TemporalAccessor change, from @jodastephen
 - revert TemporalAccessor change, from @jodastephen

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/23384/files
  - new: https://git.openjdk.org/jdk/pull/23384/files/b0ac02d4..5388a40e

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=23384&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23384&range=01-02

  Stats: 113 lines in 3 files changed: 5 ins; 89 del; 19 mod
  Patch: https://git.openjdk.org/jdk/pull/23384.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23384/head:pull/23384

PR: https://git.openjdk.org/jdk/pull/23384


More information about the i18n-dev mailing list