Skip to content

GROOVY-12161: Omit identity catch-all for try/catch without finally and slim exception bytecode#2706

Open
daniellansun wants to merge 1 commit into
masterfrom
GROOVY-12161
Open

GROOVY-12161: Omit identity catch-all for try/catch without finally and slim exception bytecode#2706
daniellansun wants to merge 1 commit into
masterfrom
GROOVY-12161

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: 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-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.0906%. Comparing base (86c6648) to head (47a13fc).

Additional details and impacted files

Impacted file tree graph

@@                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     
Files with missing lines Coverage Δ
...org/codehaus/groovy/classgen/asm/CompileStack.java 86.3081% <ø> (-0.2773%) ⬇️
.../codehaus/groovy/classgen/asm/StatementWriter.java 96.9697% <100.0000%> (+0.0785%) ⬆️

... and 16 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.

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

JMH summary — classic (commit 5dfdfba)

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.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

@github-actions

Copy link
Copy Markdown
Contributor

JMH summary — indy (commit 5dfdfba)

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 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

@testlens-app

testlens-app Bot commented Jul 13, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 47a13fc
▶️ Tests: 103841 executed
⚪️ Checks: 31/31 completed


Learn more about TestLens at testlens.app.


mv.visitInsn(NOP);
// start marks the first instruction after all inlined finally blocks.
mv.visitLabel(start);

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 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.

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.

They had been stable before, why not anymore?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

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.

3 participants