GROOVY-12259: Make category/bulk call-site invalidation O(live SwitchPoint domains) instead of O(loaded classes) (includes GROOVY-12258) #2432
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Licensed to the Apache Software Foundation (ASF) under one or more | |
| # contributor license agreements. See the NOTICE file distributed with | |
| # this work for additional information regarding copyright ownership. | |
| # The ASF licenses this file to You under the Apache License, Version 2.0 | |
| # (the "License"); you may not use this file except in compliance with | |
| # the License. You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| name: jmh | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - GROOVY_* | |
| pull_request: | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| test: | |
| if: >- | |
| contains(github.event.head_commit.message || '', 'GROOVY-') || | |
| contains(github.event.pull_request.title || '', 'GROOVY-') | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - suite: bench | |
| pattern: '\\.bench\\.' | |
| - suite: core-ag | |
| pattern: '\\.perf\\.[A-G]' | |
| - suite: core-hz | |
| pattern: '\\.perf\\.[H-Z]' | |
| - suite: grails-ad | |
| pattern: '\\.perf\\.grails\\.[A-D]' | |
| - suite: grails-ez | |
| pattern: '\\.perf\\.grails\\.[E-Z]' | |
| runs-on: ubuntu-latest | |
| env: | |
| DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} | |
| steps: | |
| - uses: actions/checkout@v7.0.1 | |
| - uses: actions/setup-java@v5.7.0 | |
| with: | |
| distribution: 'zulu' | |
| java-version: 21 | |
| check-latest: true | |
| # Cache downloaded dependency jars/poms + wrapper dists, keyed per | |
| # branch; see groovy-build-test.yml (lts job) for the full rationale. | |
| # The `perf` key segment keeps a cache lineage for the perf/JMH | |
| # workflow family, whose dependency set differs from the main build. | |
| - name: "🗄 Cache Gradle dependencies (~/.gradle/caches/modules-2 + wrapper)" | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: | | |
| ~/.gradle/caches/modules-2 | |
| ~/.gradle/wrapper | |
| key: gradle-deps-${{ runner.os }}-perf-${{ github.base_ref || github.ref_name }}-${{ hashFiles('versions.properties', 'gradle/wrapper/gradle-wrapper.properties', 'settings.gradle', 'build-logic/build.gradle') }} | |
| restore-keys: | | |
| gradle-deps-${{ runner.os }}-perf-${{ github.base_ref || github.ref_name }}- | |
| - uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 | |
| # The action's own caching is disabled: dependency jars and wrapper | |
| # dists are cached by the explicit branch-keyed step above instead. | |
| with: | |
| cache-disabled: true | |
| - name: JMH (${{ matrix.suite }}) | |
| run: ./gradlew perf:jmh -PbenchInclude=${{ matrix.pattern }} -PjmhResultFormat=JSON | |
| timeout-minutes: 60 | |
| - name: Rename JMH result file | |
| run: | | |
| mv subprojects/performance/build/results/jmh/results.json \ | |
| subprojects/performance/build/results/jmh/results-${{ matrix.suite }}.json | |
| - name: Fetch historical baseline | |
| id: baseline | |
| run: | | |
| URL="https://apache.github.io/groovy/dev/bench/jmh/${{ matrix.suite }}/indy/data.js" | |
| # --proto / --proto-redir pin HTTPS so a redirect cannot downgrade to HTTP (githubactions:S6506) | |
| if curl -fsSL --proto '=https' --proto-redir '=https' "$URL" -o data.js; then | |
| sed -e 's/^window\.BENCHMARK_DATA = //' -e 's/;[[:space:]]*$//' data.js > prev.json | |
| echo 'found=true' >> "$GITHUB_OUTPUT" | |
| else | |
| # the action cannot handle an empty external data file, so skip | |
| # the compare when no baseline is published (or gh-pages is down) | |
| echo 'No baseline for ${{ matrix.suite }} on gh-pages; skipping comparison.' | |
| echo 'found=false' >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Compare against history | |
| if: steps.baseline.outputs.found == 'true' | |
| uses: benchmark-action/github-action-benchmark@52576c92bccf6ac60c8223ec7eb2565637cae9ba # v1.22.1 | |
| with: | |
| tool: 'jmh' | |
| output-file-path: subprojects/performance/build/results/jmh/results-${{ matrix.suite }}.json | |
| external-data-json-path: ./prev.json | |
| save-data-file: false | |
| summary-always: true | |
| # fork PRs get a read-only token; commenting there would 403 and fail the step | |
| comment-on-alert: ${{ github.event.pull_request.head.repo.full_name == github.repository }} | |
| alert-threshold: '150%' | |
| fail-on-alert: false | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload reports-jmh-${{ matrix.suite }} | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: reports-jmh-${{ matrix.suite }} | |
| path: subprojects/performance/build/results/jmh/ | |
| summary: | |
| needs: test | |
| if: >- | |
| always() && | |
| (contains(github.event.head_commit.message || '', 'GROOVY-') || | |
| contains(github.event.pull_request.title || '', 'GROOVY-')) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7.0.1 | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| path: artifacts | |
| pattern: reports-jmh-* | |
| merge-multiple: true | |
| - name: Per-commit JMH group summary | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| python3 subprojects/performance/dashboard/jmh-summary.py \ | |
| --mode indy \ | |
| --results-dir artifacts \ | |
| --pr-number "${{ github.event.pull_request.number }}" | |