RFR: 8276904: Optional.toString() is unnecessarily expensive

Brian Goetz brian.goetz at oracle.com
Wed Nov 10 18:12:34 UTC 2021


I would suggest that we hold this patch until the string interpolation 
JEP lands.  It will offer both better readability *and* better 
performance, and probably better to have one round of "replace all the 
toString implementations" than two?

On 11/10/2021 1:04 PM, Eamonn McManus wrote:
> Use string concatenation instead of `String.format`.
>
> -------------
>
> Commit messages:
>   - 8276904: Optional.toString() is unnecessarily expensive
>
> Changes:https://git.openjdk.java.net/jdk/pull/6337/files
>   Webrev:https://webrevs.openjdk.java.net/?repo=jdk&pr=6337&range=00
>    Issue:https://bugs.openjdk.java.net/browse/JDK-8276904
>    Stats: 4 lines in 4 files changed: 0 ins; 0 del; 4 mod
>    Patch:https://git.openjdk.java.net/jdk/pull/6337.diff
>    Fetch: git fetchhttps://git.openjdk.java.net/jdk  pull/6337/head:pull/6337
>
> PR:https://git.openjdk.java.net/jdk/pull/6337


More information about the core-libs-dev mailing list