Skip to content

Commit cb35b63

Browse files
jamesfredleypaulk-asert
authored andcommitted
Move grails benchmarks to subpackage and split perf workflows via matrix
Move the 4 Grails-like benchmark files into org.apache.groovy.perf.grails subpackage and add a matrix strategy to the jmh-perf and jmh-perf-classic workflows so core and grails benchmarks run as parallel CI jobs, each with its own 60-minute budget. Restore original @fork(2) and @measurement(iterations=5) settings now that the benchmarks have dedicated time slots.
1 parent 73917cd commit cb35b63

6 files changed

Lines changed: 32 additions & 20 deletions

File tree

.github/workflows/groovy-jmh-perf-classic.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ jobs:
2424
test:
2525
strategy:
2626
fail-fast: false
27+
matrix:
28+
include:
29+
- suite: core
30+
pattern: '\\.perf\\.[A-Z]'
31+
- suite: grails
32+
pattern: '\\.perf\\.grails\\.'
2733
runs-on: ubuntu-latest
2834
env:
2935
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
@@ -35,11 +41,11 @@ jobs:
3541
java-version: 21
3642
check-latest: true
3743
- uses: gradle/actions/setup-gradle@v5
38-
- name: Benchmarks (perf classic)
39-
run: ./gradlew perf:jmh -PbenchInclude=\\.perf\\. -Pindy=false
44+
- name: Benchmarks (perf classic ${{ matrix.suite }})
45+
run: ./gradlew perf:jmh -PbenchInclude=${{ matrix.pattern }} -Pindy=false
4046
timeout-minutes: 60
41-
- name: Upload reports-jmh-perf-classic
47+
- name: Upload reports-jmh-perf-classic-${{ matrix.suite }}
4248
uses: actions/upload-artifact@v6
4349
with:
44-
name: reports-jmh-perf-classic
50+
name: reports-jmh-perf-classic-${{ matrix.suite }}
4551
path: subprojects/performance/build/results/jmh/

.github/workflows/groovy-jmh-perf.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ jobs:
2424
test:
2525
strategy:
2626
fail-fast: false
27+
matrix:
28+
include:
29+
- suite: core
30+
pattern: '\\.perf\\.[A-Z]'
31+
- suite: grails
32+
pattern: '\\.perf\\.grails\\.'
2733
runs-on: ubuntu-latest
2834
env:
2935
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
@@ -35,12 +41,12 @@ jobs:
3541
java-version: 21
3642
check-latest: true
3743
- uses: gradle/actions/setup-gradle@v5
38-
- name: Benchmarks (perf)
39-
run: ./gradlew perf:jmh -PbenchInclude=\\.perf\\.
44+
- name: Benchmarks (perf ${{ matrix.suite }})
45+
run: ./gradlew perf:jmh -PbenchInclude=${{ matrix.pattern }}
4046
timeout-minutes: 60
41-
- name: Upload reports-jmh-perf
47+
- name: Upload reports-jmh-perf-${{ matrix.suite }}
4248
uses: actions/upload-artifact@v6
4349
with:
44-
name: reports-jmh-perf
50+
name: reports-jmh-perf-${{ matrix.suite }}
4551
path: subprojects/performance/build/results/jmh/
4652

subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/CategoryBench.groovy renamed to subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/grails/CategoryBench.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
package org.apache.groovy.perf
19+
package org.apache.groovy.perf.grails
2020

2121
import org.openjdk.jmh.annotations.*
2222
import org.openjdk.jmh.infra.Blackhole
@@ -39,8 +39,8 @@ import java.util.concurrent.TimeUnit
3939
* validation helpers, and domain class extensions.
4040
*/
4141
@Warmup(iterations = 3, time = 2, timeUnit = TimeUnit.SECONDS)
42-
@Measurement(iterations = 3, time = 2, timeUnit = TimeUnit.SECONDS)
43-
@Fork(1)
42+
@Measurement(iterations = 5, time = 2, timeUnit = TimeUnit.SECONDS)
43+
@Fork(2)
4444
@BenchmarkMode(Mode.AverageTime)
4545
@OutputTimeUnit(TimeUnit.MILLISECONDS)
4646
@State(Scope.Thread)

subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/DynamicDispatchBench.groovy renamed to subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/grails/DynamicDispatchBench.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
package org.apache.groovy.perf
19+
package org.apache.groovy.perf.grails
2020

2121
import groovy.lang.GroovySystem
2222

@@ -45,8 +45,8 @@ import java.util.concurrent.TimeUnit
4545
* regardless of caching.
4646
*/
4747
@Warmup(iterations = 3, time = 2, timeUnit = TimeUnit.SECONDS)
48-
@Measurement(iterations = 3, time = 2, timeUnit = TimeUnit.SECONDS)
49-
@Fork(1)
48+
@Measurement(iterations = 5, time = 2, timeUnit = TimeUnit.SECONDS)
49+
@Fork(2)
5050
@BenchmarkMode(Mode.AverageTime)
5151
@OutputTimeUnit(TimeUnit.MILLISECONDS)
5252
@State(Scope.Thread)

subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/GrailsLikePatternsBench.groovy renamed to subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/grails/GrailsLikePatternsBench.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
package org.apache.groovy.perf
19+
package org.apache.groovy.perf.grails
2020

2121
import groovy.lang.GroovySystem
2222

@@ -46,8 +46,8 @@ import java.util.concurrent.TimeUnit
4646
* </ul>
4747
*/
4848
@Warmup(iterations = 3, time = 2, timeUnit = TimeUnit.SECONDS)
49-
@Measurement(iterations = 3, time = 2, timeUnit = TimeUnit.SECONDS)
50-
@Fork(1)
49+
@Measurement(iterations = 5, time = 2, timeUnit = TimeUnit.SECONDS)
50+
@Fork(2)
5151
@BenchmarkMode(Mode.AverageTime)
5252
@OutputTimeUnit(TimeUnit.MILLISECONDS)
5353
@State(Scope.Thread)

subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/MetaclassChangeBench.groovy renamed to subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/grails/MetaclassChangeBench.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
package org.apache.groovy.perf
19+
package org.apache.groovy.perf.grails
2020

2121
import groovy.lang.ExpandoMetaClass
2222
import groovy.lang.GroovySystem
@@ -43,8 +43,8 @@ import java.util.concurrent.TimeUnit
4343
* modification variants to measure the invalidation overhead.
4444
*/
4545
@Warmup(iterations = 3, time = 2, timeUnit = TimeUnit.SECONDS)
46-
@Measurement(iterations = 3, time = 2, timeUnit = TimeUnit.SECONDS)
47-
@Fork(1)
46+
@Measurement(iterations = 5, time = 2, timeUnit = TimeUnit.SECONDS)
47+
@Fork(2)
4848
@BenchmarkMode(Mode.AverageTime)
4949
@OutputTimeUnit(TimeUnit.MILLISECONDS)
5050
@State(Scope.Thread)

0 commit comments

Comments
 (0)