GROOVY-12185: Move classic call-site caching into optional groovy-callsite module - #2730
Conversation
9c7a08f to
c42badc
Compare
There was a problem hiding this comment.
⚠️ 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.
JMH summary — classic (commit
|
| 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
JMH summary — indy (commit
|
| 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
left a comment
There was a problem hiding this comment.
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 Report❌ Patch coverage is Additional details and impacted files@@ 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
🚀 New features to boost your workflow:
|
|
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. |
c42badc to
4eccbf1
Compare
4eccbf1 to
5e76b04
Compare
|
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.
|
✅ All tests passed ✅🏷️ Commit: c09e705 Learn more about TestLens at testlens.app. |


https://issues.apache.org/jira/browse/GROOVY-12185