[jdk21u-dev] RFR: 8317264: Pattern.Bound has `static` fields that should be `static final`.
Francesco Andreuzzi
duke at openjdk.org
Thu Apr 24 13:26:50 UTC 2025
On Thu, 24 Apr 2025 07:54:22 GMT, Goetz Lindenmaier <goetz at openjdk.org> wrote:
>> Clean backport of JDK-8317264. The fields are never assigned after initialization. final leads to shorter bytecode. It's a minor performance optimization in Regex.
>
> Hi @fandreuz
> Why do you want to backport this? Please amend the fix request comment with a reasoning. We usually don't backport performance enhancements.
Hi @GoeLin, thanks for your feedback. This is a minor performance optimization that gives us a small improvement for `Pattern`, without much, if any, risk. So we believe the cost/benefit for this optimization is still good for JDK 21.
-------------
PR Comment: https://git.openjdk.org/jdk21u-dev/pull/1622#issuecomment-2827624818
More information about the jdk-updates-dev
mailing list