[
https://issues.apache.org/jira/browse/GROOVY-11905?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18071233#comment-18071233
]
ASF GitHub Bot commented on GROOVY-11905:
-----------------------------------------
codecov-commenter commented on PR #2438:
URL: https://github.com/apache/groovy/pull/2438#issuecomment-4188962797
##
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2438?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 66.4943%. Comparing base
([`3bc4500`](https://app.codecov.io/gh/apache/groovy/commit/3bc4500b6c10b59711a88b940448eb72a1767a50?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
to head
([`a5a53a8`](https://app.codecov.io/gh/apache/groovy/commit/a5a53a8d8acbcc2a1cb9ae9a0141ffc2e582e285?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/groovy/pull/2438?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #2438 +/- ##
==================================================
+ Coverage 66.4920% 66.4943% +0.0023%
- Complexity 30253 30260 +7
==================================================
Files 1404 1404
Lines 117569 117580 +11
Branches 20848 20853 +5
==================================================
+ Hits 78174 78184 +10
+ Misses 32995 32994 -1
- Partials 6400 6402 +2
```
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/2438?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
| Coverage Δ | |
|---|---|---|
|
[...roovy/classgen/asm/sc/StaticTypesLambdaWriter.java](https://app.codecov.io/gh/apache/groovy/pull/2438?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticTypesLambdaWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNUeXBlc0xhbWJkYVdyaXRlci5qYXZh)
| `97.4359% <100.0000%> (+0.1945%)` | :arrow_up: |
... and [4 files with indirect coverage
changes](https://app.codecov.io/gh/apache/groovy/pull/2438/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test
Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests,
report on failures, and find test suite problems.
- :package: [JS Bundle
Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save
yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
> Optimize non-capturing lambdas
> ------------------------------
>
> Key: GROOVY-11905
> URL: https://issues.apache.org/jira/browse/GROOVY-11905
> Project: Groovy
> Issue Type: Improvement
> Reporter: Daniel Sun
> Priority: Major
>
> *Problem* Previously, every non-capturing lambda call site incurred
> unnecessary allocation overhead. The compiler would:
> # Generate a {{Closure}} wrapper instance via {{NEW}} +
> {{{}INVOKESPECIAL{}}}.
> # Pass it as a captured argument to the {{invokedynamic}} instruction.
> This forced {{LambdaMetafactory}} to generate a new proxy instance per
> invocation, completely defeating JVM singleton optimizations.
> *Solution* For non-capturing lambdas (no shared variables, no instance member
> access, non-serializable), we now align the compilation strategy with Java's
> behavior by eliminating the capture phase. The new emitted bytecode features:
> * A {{static}} modifier on the generated {{doCall}} method.
> * A capture-free {{invokedynamic}} instruction with the descriptor
> {{{}()LFunctionalInterface;{}}}.
> * An {{H_INVOKESTATIC}} method handle pointing directly to the static
> {{{}doCall{}}}.
> *Impact*
> * {{LambdaMetafactory}} now creates and caches a singleton instance,
> returning a {{{}ConstantCallSite{}}}.
> * Achieves *zero-allocation* at the call site for non-capturing lambdas.
> * Matches standard Java execution behavior, significantly reducing GC
> footprint.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)