On Wed, 20 May 2026 20:27:03 GMT, jengebr <[email protected]> wrote: > ## Opportunity > > JDK-836829 describes runtime overhead due to global megamorphism, which can > be overcome by considering only local *morphism. This change eliminates the > overhead from a sometimes ultra-hot method, Writer.append(CharSequence). > > ## Solution > The core change is moving from String.valueOf(Object) (with global profiling) > to a method-local call to CharSequence.toString() (with local profiling and a > clear optimization target, String). The included benchmark shows an > improvement around 60% when passing a String (table below, benchmark in PR). > > Should be backportable. > > | input | pre-fix ns | post-fix ns | delta (ns) | delta (%) | > |---|---|---|---|---| > | string | 4.611 | 1.724 | −2.89 | −62.6% | > > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai).
This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/31224
