GROOVY-12065: Implement peephole optimization for bytecode generation#2591
GROOVY-12065: Implement peephole optimization for bytecode generation#2591daniellansun wants to merge 1 commit into
Conversation
377c68b to
d1aeb66
Compare
d1aeb66 to
043340d
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: d61c051 | Previous: 80d37ed | Ratio |
|---|---|---|---|
org.apache.groovy.bench.GeneratedHashCodeBench.generated_hashcode_on_instance_with_null_properties |
206473.262991253 ops/ms |
101686.67767570786 ops/ms |
2.03 |
org.apache.groovy.bench.NonCapturingLambdaBench.capturingLambdaApply |
114855.81227187793 ops/ms |
44607.24325271937 ops/ms |
2.57 |
org.apache.groovy.bench.NonCapturingLambdaBench.nonCapturingLambdaApply |
4462045.07373645 ops/ms |
2666189.9899859093 ops/ms |
1.67 |
org.apache.groovy.bench.NonCapturingLambdaBench.streamMapNonCapturing |
26851.632887995627 ops/ms |
12128.564491971898 ops/ms |
2.21 |
org.apache.groovy.bench.NonCapturingLambdaBench.streamReduceNonCapturing |
31584.498780732538 ops/ms |
16476.687913502024 ops/ms |
1.92 |
org.apache.groovy.bench.StaticMethodCallIndyBench.instanceChain_groovy |
186.47874964689734 ops/ms |
88.07590042330493 ops/ms |
2.12 |
org.apache.groovy.bench.StaticMethodCallIndyBench.instanceFib_groovy |
2.0535216132698673 ops/ms |
0.9529014936194289 ops/ms |
2.16 |
org.apache.groovy.bench.StaticMethodCallIndyBench.instanceSum_groovy |
248.8433206485209 ops/ms |
112.34655416823993 ops/ms |
2.21 |
org.apache.groovy.bench.StaticMethodCallIndyBench.staticChain_groovy |
1101.2554170097449 ops/ms |
558.6234326127244 ops/ms |
1.97 |
org.apache.groovy.bench.StaticMethodCallIndyBench.staticChain_groovyCS |
4015.2515353298645 ops/ms |
2244.546309477836 ops/ms |
1.79 |
org.apache.groovy.bench.StaticMethodCallIndyBench.staticChain_java |
4000.5574692987348 ops/ms |
2249.8921119057513 ops/ms |
1.78 |
org.apache.groovy.bench.StaticMethodCallIndyBench.staticFib_groovy |
4.7410570800946275 ops/ms |
2.0170595087888286 ops/ms |
2.35 |
org.apache.groovy.bench.StaticMethodCallIndyBench.staticFib_groovyCS |
6.416847256690123 ops/ms |
3.378655965391002 ops/ms |
1.90 |
org.apache.groovy.bench.StaticMethodCallIndyBench.staticFib_java |
6.433115477992071 ops/ms |
3.3886799437423605 ops/ms |
1.90 |
org.apache.groovy.bench.StaticMethodCallIndyBench.staticSum_groovy |
1414.7352251610673 ops/ms |
561.1447803969829 ops/ms |
2.52 |
org.apache.groovy.bench.StaticMethodCallIndyBench.staticSum_groovyCS |
4726.8031520249715 ops/ms |
3001.903992147817 ops/ms |
1.57 |
org.apache.groovy.bench.StaticMethodCallIndyBench.staticSum_java |
4746.986812329111 ops/ms |
2996.0612402877814 ops/ms |
1.58 |
org.apache.groovy.bench.dispatch.CallsiteBench.dispatch_1_monomorphic_groovy |
7341.397993341676 ops/ms |
3542.3625342376827 ops/ms |
2.07 |
org.apache.groovy.bench.dispatch.CallsiteBench.dispatch_1_monomorphic_groovyCS |
27498.867932101064 ops/ms |
15666.595252222818 ops/ms |
1.76 |
org.apache.groovy.bench.dispatch.CallsiteBench.dispatch_1_monomorphic_java |
73262.78201459142 ops/ms |
35558.21847709362 ops/ms |
2.06 |
org.apache.groovy.bench.dispatch.CallsiteBench.dispatch_3_polymorphic_groovyCS |
25836.540603735324 ops/ms |
13563.842036943028 ops/ms |
1.90 |
org.apache.groovy.bench.dispatch.CallsiteBench.dispatch_3_polymorphic_java |
8581.052253645397 ops/ms |
1936.1250218518248 ops/ms |
4.43 |
org.apache.groovy.bench.dispatch.CallsiteBench.dispatch_8_megamorphic_groovyCS |
25962.532224721283 ops/ms |
13586.404324443225 ops/ms |
1.91 |
org.apache.groovy.bench.dispatch.CallsiteBench.dispatch_8_megamorphic_java |
8595.278968583092 ops/ms |
1599.7052607830838 ops/ms |
5.37 |
This comment was automatically generated by workflow using github-action-benchmark.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2591 +/- ##
==================================================
+ Coverage 68.5703% 68.6424% +0.0721%
- Complexity 33809 33953 +144
==================================================
Files 1524 1525 +1
Lines 128143 128495 +352
Branches 23292 23318 +26
==================================================
+ Hits 87868 88202 +334
- Misses 32476 32480 +4
- Partials 7799 7813 +14
🚀 New features to boost your workflow:
|
JMH summary — classic (commit
|
| Group | Speedup | n |
|---|---|---|
| bench | 1.003 × | 26 |
| core | 1.038 × | 77 |
| grails | 0.991 × | 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 | 1.966 × | 26 |
| core | 3.447 × | 77 |
| grails | 2.523 × | 80 |
Baseline: dev/bench/jmh/<part>/indy/data.js on gh-pages, trailing 90 days. Daily dashboard · Per-suite raw data
043340d to
d4cb73b
Compare
4525305 to
2a55a90
Compare
| } else if (isPrimitiveLong(type) || isPrimitiveFloat(type) || isPrimitiveDouble(type)) { | ||
| mv.visitLdcInsn(value); |
There was a problem hiding this comment.
Doesn't this require LCONST_0 and so on so the operand stack type is correct?
There was a problem hiding this comment.
Maybe it was different when most of the bytecode code was written, but current version of asm actually handle the special case internally: https://asm.ow2.io/javadoc/org/objectweb/asm/MethodVisitor.html#visitLdcInsn(java.lang.Object) - AFAIK
2a55a90 to
298263d
Compare
298263d to
d61c051
Compare
|
✅ All tests passed ✅🏷️ Commit: d61c051 Learn more about TestLens at testlens.app. |



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