Hi Jenn! I think a good way to test this is to use JMH. And for this particular scenario, find a method that would exceed the maximum bytecode size for inlining, and would go below that limit with your optimization.
2017-04-06 11:12 GMT+02:00 Jennifer Strater <jenn.stra...@gmail.com>: > 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? > > Thanks, > Jenn >