On Sun, 25 Aug 2024 12:13:34 GMT, Shaojin Wen <d...@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

Reply via email to