You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniel Sun (Jira)" <ji...@apache.org> on 2019/11/25 23:52:00 UTC

[jira] [Assigned] (GROOVY-9072) Avoid creating inner classes for simple native lambda expressions

     [ https://issues.apache.org/jira/browse/GROOVY-9072?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Sun reassigned GROOVY-9072:
----------------------------------

    Assignee:     (was: Daniel Sun)

> Avoid creating inner classes for simple native lambda expressions
> -----------------------------------------------------------------
>
>                 Key: GROOVY-9072
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9072
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Daniel Sun
>            Priority: Major
>
> Groovy will create inner classes for each native lambda expression because native lambda expression is versatile and mimic the behavior of closure as possible as it can.
> As a result, the performance of native lambda expression will be a bit less efficient than Java lambda expression.
> We can generate almost same bytecode for the simple native lambda expressions, e.g. no re-assignment of shared variables in the lambda expression body, no nested lambda expression.
>  The improvement can cover most of usual cases, e.g.
> {code:java}
> Stream.of(1, -2, 3).map(e -> Math.abs(e))
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)