Skip to content

GROOVY-12185: Move classic call-site caching into optional groovy-callsite module - #2730

Merged
daniellansun merged 2 commits into
masterfrom
GROOVY-12185
Jul 26, 2026
Merged

GROOVY-12185: Move classic call-site caching into optional groovy-callsite module#2730
daniellansun merged 2 commits into
masterfrom
GROOVY-12185

Conversation

@daniellansun

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.

Benchmark suite Current: c09e705 Previous: 19db4fd Ratio
org.apache.groovy.bench.AckermannBench.java ( {"n":"6"} ) 0.2715905231090218 ms/op 0.16719900713952437 ms/op 1.62
org.apache.groovy.bench.AckermannBench.java ( {"n":"7"} ) 1.3352875145608591 ms/op 0.6494684581601622 ms/op 2.06
org.apache.groovy.bench.AryBench.groovyCS ( {"n":"1000"} ) 0.05876108746955231 ms/op 0.03818228745279311 ms/op 1.54
org.apache.groovy.bench.AryBench.java ( {"n":"1000"} ) 0.11936168501801936 ms/op 0.04438660762510084 ms/op 2.69
org.apache.groovy.bench.CalibrationBench.memoryPointerChase 1007.5991660048334 us/op 457.7870007674895 us/op 2.20
org.apache.groovy.bench.StaticMethodCallIndyColdBench.staticSum_java ( {"n":"2000"} ) 50.201625000000014 us/op 32.2579875 us/op 1.56
org.apache.groovy.bench.StaticMethodCallIndyColdBench.staticSum_java ( {"n":"20000"} ) 431.71316249999984 us/op 256.35606249999984 us/op 1.68

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

JMH summary — classic (commit 4bc09e8)

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.994 × 1.014 × 92
core 1.044 × 1.059 × 77
grails 0.966 × 0.994 × 80

Runner calibration (this run vs baseline hardware): bench 0.98× (26 rulers) · core-ag 0.98× (3 rulers) · core-hz 0.99× (3 rulers) · grails-ad 0.96× (3 rulers) · grails-ez 0.98× (3 rulers)

Baseline: dev/bench/jmh/<part>/classic/data.js on gh-pages, trailing 90 days. Daily dashboard · Per-suite raw data

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

JMH summary — indy (commit 4bc09e8)

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.961 × 0.996 × 92
core 3.519 × 3.618 × 77
grails 2.174 × 2.144 × 80

Runner calibration (this run vs baseline hardware): bench 0.96× (26 rulers) · core-ag 0.98× (3 rulers) · core-hz 0.97× (3 rulers) · grails-ad 1.12× (3 rulers) · grails-ez 0.93× (3 rulers)

Baseline: dev/bench/jmh/<part>/indy/data.js on gh-pages, trailing 90 days. Daily dashboard · Per-suite raw data

@blackdrag blackdrag left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a bit worried about the metaclass changes since it kind of means changing public API. And I was wondering if can somehow provide an alternative. Maybe we don´t need that as most people probably do not use those callsite methods. But if we do need to compatibility I was wondering if we could solve it with a parallel meta class system. What I mean is that if callsites are active we use the callsite variants and otherwise we use the normal meta class. Maybe the callsite meta classes could just wrap the normal metaclass and delegate calls... the classic way of trying to solve a problem by adding a level of indirection. But the basic question is really: Do we need to keep those methods on the meta classes? @paulk-asert what do you think? If we say we do not need it, then I would agree to the change.

@codecov-commenter

codecov-commenter commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 65.46763% with 48 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.8671%. Comparing base (c513a3a) to head (c09e705).
⚠️ Report is 13 commits behind head on master.

Files with missing lines Patch % Lines
...us/groovy/runtime/callsite/MetaClassCallSites.java 44.6154% 22 Missing and 14 partials ⚠️
...groovy/runtime/callsite/CachedMethodCallSites.java 83.7838% 5 Missing and 1 partial ⚠️
...codehaus/groovy/classgen/asm/WriterController.java 63.6364% 1 Missing and 3 partials ⚠️
src/main/java/groovy/lang/MetaClassImpl.java 50.0000% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##               master      #2730        +/-   ##
==================================================
+ Coverage     69.3657%   69.8671%   +0.5014%     
- Complexity      35082      35139        +57     
==================================================
  Files            1553       1554         +1     
  Lines          131490     130731       -759     
  Branches        24045      23916       -129     
==================================================
+ Hits            91209      91338       +129     
+ Misses          32045      31146       -899     
- Partials         8236       8247        +11     
Files with missing lines Coverage Δ
src/main/java/groovy/lang/ExpandoMetaClass.java 79.0787% <100.0000%> (+1.9411%) ⬆️
...g/codehaus/groovy/classgen/asm/CallSiteWriter.java 86.5385% <100.0000%> (+0.9615%) ⬆️
...codehaus/groovy/control/CompilerConfiguration.java 73.6156% <ø> (+0.7968%) ⬆️
...va/org/codehaus/groovy/reflection/CachedClass.java 71.0084% <ø> (-0.3609%) ⬇️
...a/org/codehaus/groovy/reflection/CachedMethod.java 80.3738% <ø> (+16.2713%) ⬆️
...roovy/reflection/ClassLoaderForClassArtifacts.java 75.0000% <100.0000%> (ø)
...dehaus/groovy/runtime/dgmimpl/NumberNumberDiv.java 100.0000% <ø> (+96.4602%) ⬆️
...groovy/runtime/dgmimpl/NumberNumberMetaMethod.java 87.5000% <ø> (+73.2143%) ⬆️
...haus/groovy/runtime/dgmimpl/NumberNumberMinus.java 100.0000% <ø> (+97.0803%) ⬆️
...s/groovy/runtime/dgmimpl/NumberNumberMultiply.java 100.0000% <ø> (+97.0803%) ⬆️
... and 57 more

... and 13 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@paulk-asert

Copy link
Copy Markdown
Contributor

I am keen for this work to be eventually done. I need to think more about whether we are ready for this in Groovy 6 or whether this might be better in Groovy 7. I will need a few more days to absorb it.

@paulk-asert

Copy link
Copy Markdown
Contributor

I am +1 for 6.0.0-beta-1, if we remove the @deprecated annotations on the moved classes, MetaClassCallSites, CachedMethodCallSites, and the package-info. I am happy for javadoc that says planned for deprecation/removal in a future Groovy version. If Grails get to test beta-1 and indy still doesn't have the "up to 4x performance hit" for their use cases, I would be happy to add back in the @deprecated annotations before 6 GA since these are all classes we have earmarked for deprecation for some time.

…beta-1

Remove @Deprecated/@deprecated from moved call-site classes,
MetaClassCallSites, CachedMethodCallSites, and package-info so
6.0.0-beta-1 can be validated (e.g. Grails indy performance) without
deprecation noise. Keep soft Javadoc noting planned deprecation/removal
in a future Groovy version; formal annotations may return before 6 GA.
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
44.8% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@testlens-app

testlens-app Bot commented Jul 26, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: c09e705
▶️ Tests: 43225 executed
⚪️ Checks: 31/31 completed


Learn more about TestLens at testlens.app.

@daniellansun
daniellansun merged commit a2ff978 into master Jul 26, 2026
33 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants