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

ASF GitHub Bot commented on GROOVY-12285:
-----------------------------------------

codecov-commenter commented on PR #2823:
URL: https://github.com/apache/groovy/pull/2823#issuecomment-5379689237

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2823?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 70.2661%. Comparing base 
([`f6bc5a5`](https://app.codecov.io/gh/apache/groovy/commit/f6bc5a511c3ea79e51afe0eb26e494e544da06c1?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`90fc4e8`](https://app.codecov.io/gh/apache/groovy/commit/90fc4e8dcd5f1c85b7e1403c46e3ef46f0f4c07e?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>
   
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/groovy/pull/2823/graphs/tree.svg?width=650&height=150&src=pr&token=1r45138NfQ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/groovy/pull/2823?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #2823        +/-   ##
   ==================================================
   + Coverage     70.2624%   70.2661%   +0.0037%     
   - Complexity      36248      36257         +9     
   ==================================================
     Files            1569       1569                
     Lines          133706     133726        +20     
     Branches        24632      24634         +2     
   ==================================================
   + Hits            93945      93964        +19     
   - Misses          31250      31252         +2     
   + Partials         8511       8510         -1     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2823?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...vy/transform/stc/AbstractExtensionMethodCache.java](https://app.codecov.io/gh/apache/groovy/pull/2823?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Fstc%2FAbstractExtensionMethodCache.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9zdGMvQWJzdHJhY3RFeHRlbnNpb25NZXRob2RDYWNoZS5qYXZh)
 | `89.1304% <100.0000%> (+3.8363%)` | :arrow_up: |
   | 
[...aus/groovy/transform/stc/ExtensionMethodCache.java](https://app.codecov.io/gh/apache/groovy/pull/2823?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Fstc%2FExtensionMethodCache.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9zdGMvRXh0ZW5zaW9uTWV0aG9kQ2FjaGUuamF2YQ==)
 | `100.0000% <ø> (ø)` | |
   | 
[...roovy/transform/stc/StaticTypeCheckingSupport.java](https://app.codecov.io/gh/apache/groovy/pull/2823?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Fstc%2FStaticTypeCheckingSupport.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9zdGMvU3RhdGljVHlwZUNoZWNraW5nU3VwcG9ydC5qYXZh)
 | `82.5301% <100.0000%> (+0.3689%)` | :arrow_up: |
   
   ... and [9 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/2823/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>




> STC: index extension methods by name and skip cloning non-generic parameters
> ----------------------------------------------------------------------------
>
>                 Key: GROOVY-12285
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12285
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Daniel Sun
>            Priority: Major
>
> The static type checker resolves DGM (Default Groovy Methods) and other 
> extension methods by walking the receiver hierarchy and collecting methods of 
> a given name. {{ExtensionMethodCache}} stores a flat list per receiver type, 
> so each named lookup scans every method on that type. Receivers such as 
> {{Object}} and {{Collection}} have hundreds of DGM methods, and that scan 
> sits on the compile hot path.
> {{chooseBestMethod}} erases generic parameter types before measuring 
> argument-parameter distance. It currently clones every candidate's parameter 
> array to do so, including methods that have no generic parameters.
> h3. Proposed change
> * When a class loader's extension methods are scanned, index each receiver 
> list by method name so a named lookup is a hash get rather than a linear scan.
> * Clone a candidate's parameter array only when at least one parameter is a 
> generics placeholder or otherwise uses generics.
> * Drop derived indexes together with the loader's method map so they cannot 
> go stale independently.
> {code:java}
> // today
> for (MethodNode node : fromDGM) {
>     if (node.getName().equals(name)) accumulator.add(node);
> }
> // proposed
> accumulator.addAll(EXTENSION_METHOD_CACHE.get(loader, className, name));
> {code}
> h3. Impact
> Compile-time only. Named lookup results and overload selection stay the same. 
> {{MethodNode}} parameter arrays are not mutated.



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

Reply via email to