groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jennifer Strater <>
Subject Potential Bytecode Optimization
Date Thu, 06 Apr 2017 09:12:57 GMT
Hi all,

As part of a special course on compilers, I've been looking at the groovy
compiler to see how it works.  One thing we noticed is that the bytecode
generated by the Groovy compiler contains several instances of loading a
value onto the stack immediately followed by a pop. I understand how it
happens and finding a way to prevent it would be very difficult.
Therefore, I've been looking at a post pass optimization to remove these
unnecessary operations.

I can remove the extra instructions, but I'd like to see if it makes a
difference. I've used small scripts from the benchmark folder in the groovy
source repository and I've run a benchmark against the application itself,
but there hasn't been a significant difference.  Is there a better way to
approach this?


View raw message