8373566: Performance regression with java.text.MessageFormat subformat patterns#28806
8373566: Performance regression with java.text.MessageFormat subformat patterns#28806justin-curtis-lu wants to merge 6 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back jlu! A progress list of the required criteria for merging this PR into |
|
@justin-curtis-lu This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 46 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
|
@justin-curtis-lu The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
naotoj
left a comment
There was a problem hiding this comment.
Looks good. Glad we fixed the performance regression, and kudos to the bug submitter
| UNIT; | ||
|
|
||
| // Returns a FormatStyle corresponding to the input text | ||
| // DEFAULT is the empty String, the pre-defined styles are 1-1 with their |
There was a problem hiding this comment.
The comment could mention that pre-defined ones are lower case ones of the enum names, but compared with the input styles ignoring cases for historical reasons
| for (int i = 2; i < styles.length; i ++) { | ||
| var fStyle = styles[i]; | ||
| // case-insensitive comp for compatibility | ||
| if (style.compareToIgnoreCase(fStyle.toString()) == 0) { |
There was a problem hiding this comment.
| if (style.compareToIgnoreCase(fStyle.toString()) == 0) { | |
| if (style.compareToIgnoreCase(fStyle.name()) == 0) { |
| } | ||
| var styles = values(); | ||
| // Match starting at the pre-defined styles -> [SHORT:] | ||
| for (int i = 2; i < styles.length; i ++) { |
There was a problem hiding this comment.
nit: SHORT.ordinal() can be used
| } | ||
| var styles = values(); | ||
| // Match starting at the pre-defined styles -> [SHORT:] | ||
| for (int i = SHORT.ordinal(); i < styles.length; i ++) { |
There was a problem hiding this comment.
| for (int i = SHORT.ordinal(); i < styles.length; i ++) { | |
| for (int i = SHORT.ordinal(); i < styles.length; i++) { |
|
Thanks for the reviews. |
|
Going to push as commit 81e3757.
Your commit was automatically rebased without conflicts. |
|
@justin-curtis-lu Pushed as commit 81e3757. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This PR addresses a performance degradation when constructing a new MessageFormat that contains a subformat with a pattern that is not a predefined style. This is due to internal logic which catches an IAE specifically for subformat patterns. Perf tests for choice and number are not grouped, since performance is directly tied to subformat creation.
M1 Mac - Perf (before):
M1 Mac - Perf (after):
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28806/head:pull/28806$ git checkout pull/28806Update a local copy of the PR:
$ git checkout pull/28806$ git pull https://git.openjdk.org/jdk.git pull/28806/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28806View PR using the GUI difftool:
$ git pr show -t 28806Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28806.diff
Using Webrev
Link to Webrev Comment