<i18n dev> RFR: 8367271: Add parsing tests to DateFormat JMH benchmark

Naoto Sato naoto at openjdk.org
Wed Sep 10 23:23:27 UTC 2025


On Wed, 10 Sep 2025 22:20:22 GMT, Justin Lu <jlu at openjdk.org> wrote:

> This PR expands the DateFormat benchmark with parsing cases (in addition to the existing formatting ones) such that performance regressions are easier to identify for parsing. Also adding in a time instance and respective measurement tests.  The patterns used correspond to FULL Locale.ENGLISH patterns (w/ the NBSP replaced for time pattern for clarity sake).
> 
> Further context in comment on JBS issue.

Looks good. I'd suggest renaming the test case file, since this is now exclusively testing `SimpleDateFormat`, thus the test case name can be more specific.

test/micro/org/openjdk/bench/java/text/DateFormatterBench.java line 61:

> 59: 
> 60:     private final String datePattern = "EEEE, MMMM d, y";
> 61:     private final String timePattern = "h:mm:ss a zzzz";

Nit: These can be static fields (then the field names need to be all capital letters)

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

PR Review: https://git.openjdk.org/jdk/pull/27204#pullrequestreview-3208139452
PR Review Comment: https://git.openjdk.org/jdk/pull/27204#discussion_r2338137214


More information about the i18n-dev mailing list