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

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

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

   ### JMH summary — classic (commit `21dfdfc`)
   
   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.161 × | 0.985 × | 124 |
   | core | 1.314 × | 1.200 × | 108 |
   | grails | 1.293 × | 1.097 × | 80 |
   
   No benchmark is ≥1.5× slower than its 90-day baseline.
   
   > ⚠️ Runner speed differs ≥15% from the historical baseline hardware for: 
bench, core-hz, grails-ez. Raw speedups are not meaningful for those parts — 
use the calibrated column.
   
   <sub>Runner calibration (this run vs baseline hardware): bench 1.18× (27 
rulers) · core-ag 0.92× (3 rulers) · core-hz 1.50× (3 rulers) · grails-ad 1.10× 
(3 rulers) · grails-ez 1.25× (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>
   
   <!

> STC: stop writing UnionTypeClassNode into inferred-return signatures
> --------------------------------------------------------------------
>
>                 Key: GROOVY-12446
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12446
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Daniel Sun
>            Priority: Major
>
> h2. Context
> {{UnionTypeClassNode}} is a checker-only {{ClassNode}}. It represents a flow 
> type such as {{x instanceof A}} or {{x instanceof B}}. Its Javadoc says it 
> must not leak outside the type checker.
> {{SignatureCodecVersion1}} encodes an inferred return type as a Base64 
> {{DataOutputStream}} payload for {{@TypeChecked.TypeCheckingInfo}}. The first 
> UTF string in that payload is the simple name of the stored {{ClassNode}} 
> subclass.
> GROOVY-12445 locked the unknown-version rule and left union payload layout as 
> separate work. The compiler has not written {{@TypeCheckingInfo}} 
> inferred-return annotations since GROOVY-6401. There is no production reader 
> today. The codec still has to define what that payload may contain.
> h2. Problem
> {{doEncode}} wrote the tag {{UnionTypeClassNode}}, then the arm count, then 
> each arm. {{doDecode}} rebuilt a {{UnionTypeClassNode}}. That round-trips a 
> checker-only node through a class-file annotation.
> A union name is synthetic and is not a binary name. A later reader that 
> treated the decoded node as a loadable type would see a name 
> {{Class.forName}} cannot resolve.
> h2. Contract
> Version {{1}} stays version {{1}}. Newly encoded signatures never start with 
> the {{UnionTypeClassNode}} tag.
> On encode, a union is replaced with a type that has a stable binary name, 
> then that type is encoded:
> * the lowest upper bound of the arms, unwrapped until a real class or 
> interface remains
> * {{Object}} if there is no such type: empty arms, a 
> {{LowestUpperBoundClassNode}} whose superclass is {{Object}}, or a name that 
> is empty or starts with '<'
> A {{LowestUpperBoundClassNode}} supplied directly still round-trips, 
> including its interfaces. The primitive encoding tail (array flag, type 
> descriptor, generics) is unchanged.
> On decode, a historical payload whose first tag is {{UnionTypeClassNode}} is 
> still consumed. The arms are decoded, then widened by the same rule. An arm 
> count of {{0}} or less decodes as {{Object}}.
> ||Input||Encode writes||Decode returns||
> |disjoint types, e.g. {{String}} and {{List}}|{{Object}}; first tag is not 
> {{UnionTypeClassNode}}|{{Object}}|
> |{{RuntimeException}} and {{Exception}}|{{Exception}}|{{Exception}}|
> |two types that share one interface|that interface|that interface|
> |historical {{UnionTypeClassNode}} tag|(read path only)|same widening|
> |direct {{LowestUpperBoundClassNode}}|LUB tag, as today|same LUB node|
> Callers of {{SignatureCodecVersion1.decode}} that expected a union node now 
> receive the shared supertype. Method descriptors are unchanged, so 
> {{japicmp}} does not report this.
> h2. Touch points
> * {{org.codehaus.groovy.transform.stc.SignatureCodecVersion1}} — encode and 
> historical decode
> * 
> {{src/test/groovy/org/codehaus/groovy/transform/stc/SignatureCodecTest.groovy}}
>  — stable-bound and historical-payload tests
> * {{COMPATIBILITY.md}} — behavioural-change note
> h2. Scope
> This issue covers union payload layout only. The unknown-version rule is 
> GROOVY-12445. Rewiring {{addTypeCheckingInfoAnnotation}} onto 
> {{startMethodInference}}, and a new compiler diagnostic, remain separate work.



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

Reply via email to