Integrated: JDK-8306860: Avoid unnecessary allocation in when list is empty

Christoph Dreis duke at
Tue May 16 14:26:59 UTC 2023

On Mon, 10 Apr 2023 14:40:00 GMT, Christoph Dreis <duke at> wrote:

> Hi,
> I've been profiling our compilation tasks lately and noticed that `` is under the top consumers.
> <img width="1045" alt="image" src="">
> There are probably more aggressive options to optimize this, but I found that checking for empty lists already reduces the overall allocations by ~500MB for one of our compilation tasks with no measurable regressions (but also no noticeable improvements) in timings.
> <img width="943" alt="image" src="">
> In case you consider this worthwhile, I'd appreciate a sponsoring of this (including a ticket because I have no rights to create one, review etc.). I've found but this was closed as won't fix.
> Let me know what you think.
> Cheers,
> Christoph

This pull request has now been integrated.

Changeset: 23cbb2d1
Author:    Christoph Dreis <christoph.dreis at>
Committer: Vicente Romero <vromero at>
Stats:     3 lines in 1 file changed: 3 ins; 0 del; 0 mod

8306860: Avoid unnecessary allocation in when list is empty

Reviewed-by: vromero



More information about the compiler-dev mailing list