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

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

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

   ### JMH summary — classic (commit `e336c06`)
   
   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 | 0.981 × | 0.979 × | 99 |
   | core | 1.093 × | 1.136 × | 83 |
   | grails | 0.898 × | 0.919 × | 80 |
   
   > ⚠️ **7 benchmarks at least 1.5× slower than the 90-day baseline:**
   > - 
`org.apache.groovy.perf.grails.CategoryBench.categoryShadowingExistingMethod` — 
2.70× slower (calibrated)
   > - `org.apache.groovy.perf.grails.CategoryBench.nestedCategories` — 2.55× 
slower (calibrated)
   > - `org.apache.groovy.perf.grails.CategoryBench.categoryInLoop` — 2.52× 
slower (calibrated)
   > - `org.apache.groovy.perf.grails.CategoryBench.categoryWithOutsideCalls` — 
2.44× slower (calibrated)
   > - 
`org.apache.groovy.perf.grails.CategoryBench.multipleCategoriesSimultaneous` — 
2.22× slower (calibrated)
   > - 
`org.apache.groovy.perf.grails.CategoryBench.nestedCategoryOuterWrapping` — 
2.02× slower (calibrated)
   > - 
`org.apache.groovy.perf.grails.CategoryBench.threeCategoriesSimultaneous` — 
1.81× slower (calibrated)
   
   <sub>Runner calibration (this run vs baseline hardware): bench 1.00× (26 
rulers) · core-ag 0.96× (3 rulers) · core-hz 0.96× (3 rulers) · grails-ad 0.98× 
(3 rulers) · grails-ez 0.98× (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>
   
   <!

> Optimize the unrelated-default-method scan during class generation
> ------------------------------------------------------------------
>
>                 Key: GROOVY-12264
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12264
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Daniel Sun
>            Priority: Major
>
> {{Verifier}} rejects a type that inherits two unrelated {{default}} methods 
> of the same signature (GROOVY-10381, refined by GROOVY-11560). The scan runs 
> in class generation for every type that lists two or more interfaces.
> Class generation is a large share of compile wall time. The scan must stay 
> cheap on the common path, where there is no conflict.
> h3. Problem
> * Stream / {{flatMap}} allocation on every such type.
> * {{ClassNode.getAllDeclaredMethods()}} on the class and again on every 
> interface. Each call rebuilds a full hierarchy method map and revisits 
> inherited defaults.
> On a wide or deep interface DAG the second point is quadratic in the number 
> of interfaces.
> h3. Approach
> * Walk each interface's own methods ({{getMethods()}}) with loops. 
> {{getAllInterfaces()}} already includes super-interfaces, so each {{default}} 
> is visited once.
> * Build the override-signature set only when two unrelated defaults actually 
> collide, and only from the class plus its superclasses.
> * Avoid the {{Optional}} allocation in {{MethodNode.isDefault()}}.
> Before:
> {code:java}
> Set<String> declared = node.getAllDeclaredMethods().stream()
>         .filter(m -> !m.isDefault())
>         .map(MethodNodeUtils::methodDescriptorWithoutReturnType)
>         .collect(Collectors.toSet());
> node.getAllInterfaces().stream()
>         .flatMap(iface -> iface.getAllDeclaredMethods().stream())
>         .filter(MethodNode::isDefault)
>         .forEach(method -> {
>             // conflict check
>         });
> {code}
> After:
> {code:java}
> for (ClassNode iface : node.getAllInterfaces()) {
>     for (MethodNode method : iface.getMethods()) { // this interface only
>         if (!method.isDefault()) {
>             continue;
>         }
>         // conflict check; collect overrides only on a real collision
>     }
> }
> {code}
> Same conflict rules. No intended behaviour change.



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

Reply via email to