GROOVY-12024: add getAt(Map,String) and putAt(Map,String,V)#2580
Conversation
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: dc01f8c | Previous: 7bfdeea | Ratio |
|---|---|---|---|
org.apache.groovy.perf.grails.DynamicDispatchBench.invokeMethodInterception |
10.069979808420793 ms/op |
6.492504280080586 ms/op |
1.55 |
This comment was automatically generated by workflow using github-action-benchmark.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2580 +/- ##
==================================================
+ Coverage 68.1808% 68.1832% +0.0023%
Complexity 33164 33164
==================================================
Files 1511 1511
Lines 126232 126235 +3
Branches 22897 22897
==================================================
+ Hits 86066 86071 +5
+ Misses 32527 32524 -3
- Partials 7639 7640 +1
🚀 New features to boost your workflow:
|
|
JMH summary — classic (commit
|
| Group | Speedup | n |
|---|---|---|
| bench | 0.997 × | 26 |
| core | 1.141 × | 77 |
| grails | 0.977 × | 80 |
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 | n |
|---|---|---|
| bench | 0.974 × | 26 |
| core | 0.993 × | 77 |
| grails | 1.039 × | 80 |
Baseline: dev/bench/jmh/<part>/indy/data.js on gh-pages, trailing 90 days. Daily dashboard · Per-suite raw data
✅ All tests passed ✅🏷️ Commit: dc01f8c Learn more about TestLens at testlens.app. |
|
I think this is an improvement, I will try to do an assessment of all the cases tomorrow. |
|
paulk-asert
left a comment
There was a problem hiding this comment.
I think we should take this but then work on the table to close anomolies
|
The above table was wrong. Here is the revised one: For reference, here's the full Plain map —
Map subclass —
Takeaways:
|
|
To keep this up -to-date, I added a "live table" of these results in: |



Should
map['key']work likemap.keyormap.get('key')? In older Groovy versions,getAt(Map,Object)was considered closer thangetAt(Object,String). AddinggetAt(Map,String)andputAt(Map,String,V)restores alignment betweengetAtandgetat the expense of the public property handling for the subscript syntax.STC of
map['key'] = valuewould indicate "Cannot assign value of type ..." but now reports "Cannot call putAt ... with arguments ..."