You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2026/02/27 10:08:00 UTC
(groovy) 04/04: Move grails benchmarks to subpackage and split perf workflows via matrix
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit cb35b63c765103cac16c036dfbbdb67f47a6de63
Author: James Fredley <ja...@users.noreply.github.com>
AuthorDate: Thu Feb 26 17:58:23 2026 -0500
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.
---
.github/workflows/groovy-jmh-perf-classic.yml | 14 ++++++++++----
.github/workflows/groovy-jmh-perf.yml | 14 ++++++++++----
.../apache/groovy/perf/{ => grails}/CategoryBench.groovy | 6 +++---
.../groovy/perf/{ => grails}/DynamicDispatchBench.groovy | 6 +++---
.../perf/{ => grails}/GrailsLikePatternsBench.groovy | 6 +++---
.../groovy/perf/{ => grails}/MetaclassChangeBench.groovy | 6 +++---
6 files changed, 32 insertions(+), 20 deletions(-)
diff --git a/.github/workflows/groovy-jmh-perf-classic.yml b/.github/workflows/groovy-jmh-perf-classic.yml
index d3f7d7159f..276c4e11b8 100644
--- a/.github/workflows/groovy-jmh-perf-classic.yml
+++ b/.github/workflows/groovy-jmh-perf-classic.yml
@@ -24,6 +24,12 @@ jobs:
test:
strategy:
fail-fast: false
+ matrix:
+ include:
+ - suite: core
+ pattern: '\\.perf\\.[A-Z]'
+ - suite: grails
+ pattern: '\\.perf\\.grails\\.'
runs-on: ubuntu-latest
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
@@ -35,11 +41,11 @@ jobs:
java-version: 21
check-latest: true
- uses: gradle/actions/setup-gradle@v5
- - name: Benchmarks (perf classic)
- run: ./gradlew perf:jmh -PbenchInclude=\\.perf\\. -Pindy=false
+ - name: Benchmarks (perf classic ${{ matrix.suite }})
+ run: ./gradlew perf:jmh -PbenchInclude=${{ matrix.pattern }} -Pindy=false
timeout-minutes: 60
- - name: Upload reports-jmh-perf-classic
+ - name: Upload reports-jmh-perf-classic-${{ matrix.suite }}
uses: actions/upload-artifact@v6
with:
- name: reports-jmh-perf-classic
+ name: reports-jmh-perf-classic-${{ matrix.suite }}
path: subprojects/performance/build/results/jmh/
diff --git a/.github/workflows/groovy-jmh-perf.yml b/.github/workflows/groovy-jmh-perf.yml
index 359535509b..b60b596b6d 100644
--- a/.github/workflows/groovy-jmh-perf.yml
+++ b/.github/workflows/groovy-jmh-perf.yml
@@ -24,6 +24,12 @@ jobs:
test:
strategy:
fail-fast: false
+ matrix:
+ include:
+ - suite: core
+ pattern: '\\.perf\\.[A-Z]'
+ - suite: grails
+ pattern: '\\.perf\\.grails\\.'
runs-on: ubuntu-latest
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
@@ -35,12 +41,12 @@ jobs:
java-version: 21
check-latest: true
- uses: gradle/actions/setup-gradle@v5
- - name: Benchmarks (perf)
- run: ./gradlew perf:jmh -PbenchInclude=\\.perf\\.
+ - name: Benchmarks (perf ${{ matrix.suite }})
+ run: ./gradlew perf:jmh -PbenchInclude=${{ matrix.pattern }}
timeout-minutes: 60
- - name: Upload reports-jmh-perf
+ - name: Upload reports-jmh-perf-${{ matrix.suite }}
uses: actions/upload-artifact@v6
with:
- name: reports-jmh-perf
+ name: reports-jmh-perf-${{ matrix.suite }}
path: subprojects/performance/build/results/jmh/
diff --git a/subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/CategoryBench.groovy b/subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/grails/CategoryBench.groovy
similarity index 98%
rename from subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/CategoryBench.groovy
rename to subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/grails/CategoryBench.groovy
index 1cb4f8f80f..68aa32b0f5 100644
--- a/subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/CategoryBench.groovy
+++ b/subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/grails/CategoryBench.groovy
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.groovy.perf
+package org.apache.groovy.perf.grails
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
@@ -39,8 +39,8 @@ import java.util.concurrent.TimeUnit
* validation helpers, and domain class extensions.
*/
@Warmup(iterations = 3, time = 2, timeUnit = TimeUnit.SECONDS)
-@Measurement(iterations = 3, time = 2, timeUnit = TimeUnit.SECONDS)
-@Fork(1)
+@Measurement(iterations = 5, time = 2, timeUnit = TimeUnit.SECONDS)
+@Fork(2)
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Thread)
diff --git a/subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/DynamicDispatchBench.groovy b/subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/grails/DynamicDispatchBench.groovy
similarity index 98%
rename from subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/DynamicDispatchBench.groovy
rename to subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/grails/DynamicDispatchBench.groovy
index 323ff8a2a3..37b22d2c80 100644
--- a/subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/DynamicDispatchBench.groovy
+++ b/subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/grails/DynamicDispatchBench.groovy
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.groovy.perf
+package org.apache.groovy.perf.grails
import groovy.lang.GroovySystem
@@ -45,8 +45,8 @@ import java.util.concurrent.TimeUnit
* regardless of caching.
*/
@Warmup(iterations = 3, time = 2, timeUnit = TimeUnit.SECONDS)
-@Measurement(iterations = 3, time = 2, timeUnit = TimeUnit.SECONDS)
-@Fork(1)
+@Measurement(iterations = 5, time = 2, timeUnit = TimeUnit.SECONDS)
+@Fork(2)
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Thread)
diff --git a/subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/GrailsLikePatternsBench.groovy b/subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/grails/GrailsLikePatternsBench.groovy
similarity index 99%
rename from subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/GrailsLikePatternsBench.groovy
rename to subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/grails/GrailsLikePatternsBench.groovy
index 7501aa0500..17028e579b 100644
--- a/subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/GrailsLikePatternsBench.groovy
+++ b/subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/grails/GrailsLikePatternsBench.groovy
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.groovy.perf
+package org.apache.groovy.perf.grails
import groovy.lang.GroovySystem
@@ -46,8 +46,8 @@ import java.util.concurrent.TimeUnit
* </ul>
*/
@Warmup(iterations = 3, time = 2, timeUnit = TimeUnit.SECONDS)
-@Measurement(iterations = 3, time = 2, timeUnit = TimeUnit.SECONDS)
-@Fork(1)
+@Measurement(iterations = 5, time = 2, timeUnit = TimeUnit.SECONDS)
+@Fork(2)
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Thread)
diff --git a/subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/MetaclassChangeBench.groovy b/subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/grails/MetaclassChangeBench.groovy
similarity index 98%
rename from subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/MetaclassChangeBench.groovy
rename to subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/grails/MetaclassChangeBench.groovy
index 69cadcc393..edd840f5ca 100644
--- a/subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/MetaclassChangeBench.groovy
+++ b/subprojects/performance/src/jmh/groovy/org/apache/groovy/perf/grails/MetaclassChangeBench.groovy
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.groovy.perf
+package org.apache.groovy.perf.grails
import groovy.lang.ExpandoMetaClass
import groovy.lang.GroovySystem
@@ -43,8 +43,8 @@ import java.util.concurrent.TimeUnit
* modification variants to measure the invalidation overhead.
*/
@Warmup(iterations = 3, time = 2, timeUnit = TimeUnit.SECONDS)
-@Measurement(iterations = 3, time = 2, timeUnit = TimeUnit.SECONDS)
-@Fork(1)
+@Measurement(iterations = 5, time = 2, timeUnit = TimeUnit.SECONDS)
+@Fork(2)
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Thread)