RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy

Claes Redestad redestad at openjdk.org
Sun Aug 25 12:32:07 UTC 2024


On Sun, 25 Aug 2024 12:13:34 GMT, Shaojin Wen <duke at openjdk.org> wrote:

> > * Can we try to optimize the default generation shape further before we reach for this sort of specialization?
> 
> I am also thinking about this, such as the optimization of Integer/Long type parameters. Is this what you are talking about?

I'm open to any ideas. What I'm reaching for here is whether there are ways to restructure the code for larger methods to help the JIT do certain optimizations, e.g. splitting methods apart a bit to facilitate inlining and constant folding. There might be some low-hanging improvements, which then might push out when hard-coding is worthwhile.

Adding more specializations like for `Integer` is a different, more risky approach since it'll generate more classes (and reduce sharing) in the now-default strategy. For a hard-coded strategy specialization it is more natural. Without an obvious path to apply such optimization to the hottest low-arity call sites then I'm not sure it's a worthwhile endeavor, though.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/20675#issuecomment-2308813589


More information about the core-libs-dev mailing list