Reduce allocations when pretty printing JCTree during compilation

Vicente Romero vicente.romero at
Wed Feb 22 03:52:53 UTC 2023

Hi Christoph,

What are the performance benefits you get from this patch? My 
understanding is that your patch reduces the memory footprint but it 
seems like there are also performance benefits, I think. The patch looks 
good and won't affect readability although some comments should be added 
to the new `print` version to explain why it is a better fit for 
printing chars,


On 2/20/23 13:54, christoph.dreis at wrote:
> Hi,
> I’ve been profiling some build pipelines of some customer projects – 
> including their compilation phase.
> And while Lombok is a major contributor in these projects (it’s not an 
> option to drop it unfortunately), there are some optimization 
> opportunities in the JDK itself.
> I’ve opened a draft PR where you can find more information: 
> If someone finds the time to take a look, I’d highly appreciate it.
> Cheers,
> Christoph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the compiler-dev mailing list