GROOVY-10307: Add targeted JMH benchmarks for SwitchPoint invalidation#2390
Draft
jamesfredley wants to merge 1 commit intoapache:masterfrom
Draft
GROOVY-10307: Add targeted JMH benchmarks for SwitchPoint invalidation#2390jamesfredley wants to merge 1 commit intoapache:masterfrom
jamesfredley wants to merge 1 commit intoapache:masterfrom
Conversation
2cda0d5 to
46bf5e8
Compare
46bf5e8 to
e910285
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2390 +/- ##
==================================================
+ Coverage 66.7450% 66.7468% +0.0017%
- Complexity 29848 29849 +1
==================================================
Files 1382 1382
Lines 116130 116130
Branches 20471 20471
==================================================
+ Hits 77511 77513 +2
+ Misses 32286 32284 -2
Partials 6333 6333 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds three new JMH benchmark classes in
org.apache.groovy.perf.grailsthat reproduce the real-world invokedynamic performance regression observed in Grails 7 applications (GROOVY-10307).Benchmark Classes
CallSiteInvalidationBench (11 benchmarks)
Tests the core SwitchPoint invalidation mechanism - the root cause of the regression. Demonstrates that modifying ANY metaclass triggers global invalidation affecting ALL call sites:
Key result:
baselineHotLoop(0.49ms) vscrossTypeInvalidationEvery1000(467ms) = ~950x overheadMetaclassVariationBench (9 benchmarks)
Tests GORM-like patterns where domain classes get per-instance ExpandoMetaClass enhancements:
Key result:
baselineSharedMetaclass(2.0ms) vsperInstanceMetaclass(420ms) = ~207x overheadGrailsWorkloadBench (14 benchmarks)
Tests patterns extracted from the grails7-performance-regression demo app's
PerformanceTestService:.findAll{}.collect{}.groupBy{}.collectEntries{})employees*.firstName)this."$field").count{},.sum{}, map building)Key result:
baselineCollectionClosureChain(199ms) vs with invalidation (1631ms) = ~8.2x overhead (matches demo app's observed 8.2x bootRun regression)Running
Related