[ 
https://issues.apache.org/jira/browse/GROOVY-11842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18055661#comment-18055661
 ] 

Jochen Theodorou commented on GROOVY-11842:
-------------------------------------------

[~paulk] This is purely a runtime thing. As long as we do not change the 
InvokeDynamicWriter there is no different bytecode generated by the compiler 
for invokedynamic callsites. So even if compiled with 5.0.3 and this change 
being in say 5.0.4, if executed in 5.0.4 you would have the change, executed 
with 5.0.3 not. 

> Invokedynamic first invocation should not have a line with IndyInterface
> ------------------------------------------------------------------------
>
>                 Key: GROOVY-11842
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11842
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Jochen Theodorou
>            Priority: Major
>              Labels: performance
>         Attachments: improved_indy.svg, improved_indy_startup.svg, 
> screenshot-1.png
>
>
> As can be seen in the IndyInterfaceUsageTest there is a stack trace element 
> showing IndyInterface.  This is bad for inlining and general performance.
>   !improved_indy.svg!
> of course a programm like 
> {code:Java}
>   int foo(){1}
>   int a
>   for (int i=0; i<MAX; i++) {
>    a = foo()
>   }
> {code}
> is not much of a test for anything. It was supposed to show better inlining, 
> but unlike Groovy 3 all later Groovy version fail to unroll the loop and 
> eliminate the assignment to a for later executions. The graph though shows 
> that the branch performance is better than Groov 3 or 4. Not only in the long 
> run, but also on start. But be aware the graph above is from the 5th 
> iteration of 1k calls to be able to see things more in scale. The first 4 
> iterations of 1k calls look like this:
>  !improved_indy_startup.svg! 
> to actually be able to see differences the iteration size is now 100 calls 
> and the y-axis is logarithmic. I want to especially point out how the 
> no-primopts variant has similar initial cost as indy. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to