-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8316235: Optimization for DateTimeFormatter::format #15722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
👋 Welcome back wenshao! A progress list of the required criteria for merging this PR into |
|
Performance comparison data is as follows: 1. Script2. MacBookPro benchmark-Benchmark (pattern) Mode Cnt Score Error Units (baseline)
-DateTimeFormatterBench.formatInstants HH:mm:ss thrpt 15 14.888 ? 0.109 ops/ms
-DateTimeFormatterBench.formatInstants HH:mm:ss.SSS thrpt 15 10.132 ? 0.046 ops/ms
-DateTimeFormatterBench.formatInstants yyyy-MM-dd'T'HH:mm:ss thrpt 15 8.993 ? 0.039 ops/ms
-DateTimeFormatterBench.formatInstants yyyy-MM-dd'T'HH:mm:ss.SSS thrpt 15 7.400 ? 0.035 ops/ms
-DateTimeFormatterBench.formatZonedDateTime HH:mm:ss thrpt 15 21.460 ? 0.056 ops/ms
-DateTimeFormatterBench.formatZonedDateTime HH:mm:ss.SSS thrpt 15 14.439 ? 0.264 ops/ms
-DateTimeFormatterBench.formatZonedDateTime yyyy-MM-dd'T'HH:mm:ss thrpt 15 12.742 ? 0.055 ops/ms
-DateTimeFormatterBench.formatZonedDateTime yyyy-MM-dd'T'HH:mm:ss.SSS thrpt 15 9.059 ? 0.124 ops/ms
+Benchmark (pattern) Mode Cnt Score Error Units (optimized)
+DateTimeFormatterBench.formatInstants HH:mm:ss thrpt 15 28.082 ? 0.284 ops/ms (+88.62%)
+DateTimeFormatterBench.formatInstants HH:mm:ss.SSS thrpt 15 25.483 ? 0.109 ops/ms (+151.51%)
+DateTimeFormatterBench.formatInstants yyyy-MM-dd'T'HH:mm:ss thrpt 15 19.950 ? 0.444 ops/ms (+121.83%)
+DateTimeFormatterBench.formatInstants yyyy-MM-dd'T'HH:mm:ss.SSS thrpt 15 18.391 ? 0.327 ops/ms (+148.52%)
+DateTimeFormatterBench.formatZonedDateTime HH:mm:ss thrpt 15 57.870 ? 0.641 ops/ms (+169.66%)
+DateTimeFormatterBench.formatZonedDateTime HH:mm:ss.SSS thrpt 15 43.783 ? 0.300 ops/ms (+203.22%)
+DateTimeFormatterBench.formatZonedDateTime yyyy-MM-dd'T'HH:mm:ss thrpt 15 36.220 ? 0.194 ops/ms (+184.25%)
+DateTimeFormatterBench.formatZonedDateTime yyyy-MM-dd'T'HH:mm:ss.SSS thrpt 15 32.512 ? 0.583 ops/ms (+258.89%) |
src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java
Outdated
Show resolved
Hide resolved
|
/label remove i18n |
|
@wenshao |
|
/label remove security |
|
@wenshao |
|
@wenshao This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
|
@wenshao This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
In many scenarios, DateTimeFormatter::format is a slower operation.
For example, the following business scenarios
This PR provides format performance optimization for commonly used date patterns.
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15722/head:pull/15722$ git checkout pull/15722Update a local copy of the PR:
$ git checkout pull/15722$ git pull https://git.openjdk.org/jdk.git pull/15722/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 15722View PR using the GUI difftool:
$ git pr show -t 15722Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15722.diff
Webrev
Link to Webrev Comment