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

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

github-actions[bot] commented on PR #3232:
URL: https://github.com/apache/groovy/pull/3232#issuecomment-6670588357

   ### JMH summary — classic (commit `3293b11`)
   
   Speedup vs trailing 90-day baseline on gh-pages. Higher = faster.
   `1.00` = in line with history. Per-benchmark ratio, geomean within group.
   Time-per-op units inverted so direction is consistent. The *calibrated*
   column divides out this runner's speed vs the baseline hardware, as
   measured by Groovy-independent pure-Java ruler benchmarks.
   
   | Group  | Speedup | Calibrated | n |
   |--------|---------|------------|---|
   | bench | 1.145 × | 1.007 × | 124 |
   | core | 0.966 × | 1.095 × | 108 |
   | grails | 1.662 × | 1.315 × | 80 |
   
   No benchmark is ≥1.5× slower than its 90-day baseline.
   
   > ⚠️ Runner speed differs ≥15% from the historical baseline hardware for: 
grails-ad, grails-ez. Raw speedups are not meaningful for those parts — use the 
calibrated column.
   
   <sub>Runner calibration (this run vs baseline hardware): bench 1.14× (27 
rulers) · core-ag 0.87× (3 rulers) · core-hz 0.90× (3 rulers) · grails-ad 1.22× 
(3 rulers) · grails-ez 1.30× (3 rulers)</sub>
   
   <sub>Baseline: <code>dev/bench/jmh/&lt;part&gt;/classic/data.js</code> on 
gh-pages, trailing 90 days. <a 
href="https://apache.github.io/groovy/dev/bench/jmh/summary.html";>Daily 
dashboard</a> · <a 
href="https://apache.github.io/groovy/dev/bench/jmh/";>Per-suite raw 
data</a></sub>
   
   <!

> SC: a property defined by an extension method of List is read from each 
> element of the list
> -------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12534
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12534
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation
>    Affects Versions: 6.0.0
>            Reporter: Scott Murphy Heiberg
>            Assignee: Daniel Sun
>            Priority: Major
>             Fix For: 7.0.0-alpha-1, 6.0.1
>
>
> Under {{@CompileStatic}}, a property whose getter is an extension method of 
> {{List}}, or of a class that implements {{List}}, is compiled as a property 
> of the list's elements: the getter is called once for each element, with the 
> element cast to the extension's receiver type. With this extension module:
> {code:java}
> package demo;
> import java.util.List;
> public class ListExtension {
>     public static String getJoined(List<String> self) { return 
> String.join(",", self); }
> }
> {code}
> {code:groovy}
> @groovy.transform.CompileStatic
> class C {
>     def test(List<String> words) { words.joined }
> }
> new C().test(['x', 'y']) // GroovyCastException: Cannot cast object 'x' with 
> class 'java.lang.String' to class 'java.util.List'
> {code}
> {{words.getJoined()}} returns 'x,y' in every mode, and dynamic Groovy and 
> {{@TypeChecked}} return 'x,y' for {{words.joined}} too. On an empty list, 
> {{words.joined}} evaluates to {{[]}} instead of an empty string.
> {{StaticCompilationVisitor.existsProperty}} marks the property expression 
> spread-safe when the getter's declaring class implements {{List}} but does 
> not declare the getter, which is meant for a property of the element type. 
> The declaring class of an extension method is its receiver type, which never 
> declares it. Extension getters declared for {{Collection}} or {{Iterable}}, 
> such as {{getIndices}} and {{isSorted}}, are not affected. 
> {{DefaultGroovyMethodsSTCTest.testPropertySemantics2}}, which 
> {{StaticCompileDGMTest}} also runs, keeps the property forms of 
> {{getSequence(List)}} and {{getString(List)}} from {{TestStringExtension}} 
> commented out. Seen in 4.0.33, 5.0.8, 6.0.0 and master.
> Expected: the property calls the extension getter on the list, as in dynamic 
> Groovy and {{@TypeChecked}}.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to