Reduce allocations in List.map() when it is empty

christoph.dreis at freenet.de christoph.dreis at freenet.de
Thu Apr 20 08:52:20 UTC 2023


Hi,

I've been profiling our compilation tasks lately and noticed that List.map is under the top consumers.

There are probably more aggressive options to optimize List.map , 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. See https://github.com/openjdk/jdk/pull/13407 for more information and some screenshots.

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 https://bugs.openjdk.org/browse/JDK-8032359 but this was closed as won't fix.
Let me know what you think.
Cheers,
Christoph


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/compiler-dev/attachments/20230420/4c41b111/attachment.htm>


More information about the compiler-dev mailing list