[
https://issues.apache.org/jira/browse/GROOVY-11842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18052763#comment-18052763
]
ASF GitHub Bot commented on GROOVY-11842:
-----------------------------------------
blackdrag commented on PR #2369:
URL: https://github.com/apache/groovy/pull/2369#issuecomment-3766628703
I am actually hoping that I can in the long run use this as basis for a
better slow path by not having so many replacements and less generation of
MethodHandles. The immediate effect seems to be a minimal performance
improvement. Otherwise the impact is minimal. I could have done more here, but
I think it is very important to go step-by-step and slowly transform this to
real callsite caching.
> 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)