GROOVY-12161: Omit identity catch-all for try/catch without finally and slim exception bytecode#2706
GROOVY-12161: Omit identity catch-all for try/catch without finally and slim exception bytecode#2706daniellansun wants to merge 1 commit into
Conversation
…nd slim exception bytecode
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: 47a13fc | Previous: 86c6648 | Ratio |
|---|---|---|---|
org.apache.groovy.bench.AryBench.java ( {"n":"10"} ) |
0.008589232227707161 ms/op |
0.0053970045342547355 ms/op |
1.59 |
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 #2706 +/- ##
==================================================
- Coverage 69.1077% 69.0906% -0.0172%
- Complexity 34235 34239 +4
==================================================
Files 1537 1537
Lines 129356 129365 +9
Branches 23503 23509 +6
==================================================
- Hits 89395 89379 -16
- Misses 31941 31962 +21
- Partials 8020 8024 +4
🚀 New features to boost your workflow:
|
|
JMH summary — classic (commit
|
| Group | Speedup | Calibrated | n |
|---|---|---|---|
| bench | 0.969 × | 0.990 × | 84 |
| core | 1.123 × | 0.947 × | 77 |
| grails | 0.970 × | 0.878 × | 80 |
⚠️ Runner speed differs ≥15% from the historical baseline hardware for: core-hz. Raw speedups are not meaningful for those parts — use the calibrated column.
Runner calibration (this run vs baseline hardware): bench 0.98× (26 rulers) · core-ag 0.96× (3 rulers) · core-hz 1.50× (3 rulers) · grails-ad 1.07× (3 rulers) · grails-ez 1.13× (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 | 1.005 × | 1.012 × | 84 |
| core | 3.920 × | 3.309 × | 77 |
| grails | 2.247 × | 2.514 × | 80 |
⚠️ Runner speed differs ≥15% from the historical baseline hardware for: core-hz, grails-ez. Raw speedups are not meaningful for those parts — use the calibrated column.
Runner calibration (this run vs baseline hardware): bench 0.99× (26 rulers) · core-ag 0.98× (3 rulers) · core-hz 1.46× (3 rulers) · grails-ad 0.94× (3 rulers) · grails-ez 0.86× (3 rulers)
Baseline: dev/bench/jmh/<part>/indy/data.js on gh-pages, trailing 90 days. Daily dashboard · Per-suite raw data
✅ All tests passed ✅🏷️ Commit: 47a13fc Learn more about TestLens at testlens.app. |
|
|
||
| mv.visitInsn(NOP); | ||
| // start marks the first instruction after all inlined finally blocks. | ||
| mv.visitLabel(start); |
There was a problem hiding this comment.
I vaguely remember I did need those NOP instructions or else I could not set the label. I think this was for cases in which this was the first instruction in the method... maybe for an empty try-finally? not sure anymore. Or maybe I added it here back then defensively because of a similar problem in combinations with returns? But thinking back I don't think this was because of the bytecode, I think it was because of ASM. So either a bug or me not using it correctly. Very possible this is no longer an issue and thus not required.
| } | ||
| ''' | ||
| // Catch parameter must be typed Exception (GROOVY-11362), not Object. | ||
| // Label numbers are not stable across try/catch codegen improvements. |
There was a problem hiding this comment.
They had been stable before, why not anymore?
There was a problem hiding this comment.
I hope I have understood what you mean.
In the past years, I find groovy generates more complex bytecode for try-catch statement than Java does, so I wish we could refine them. As we all know, simpler and less bytecode is also friendly to JIT.
See also:
https://issues.apache.org/jira/browse/GROOVY-12161



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