Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ on:

env:
REPORT_FORMAT: ${{ (github.event_name == 'push' || github.event_name == 'pull_request' ) && 'json' || 'csv' }}
MAIN_BENCH_TASK: ${{ github.event.pull_request.number && 'prValidationBenchmark' || 'benchmark' }}
MAIN_BENCH_RESULTS: ${{ github.event.pull_request.number && 'prValidation' || 'main' }}
COMPARISON_BENCH_RESULTS: ${{ github.event.pull_request.number && 'prValidationComparison' || 'comparison' }}

concurrency:
cancel-in-progress: true
Expand All @@ -50,13 +53,13 @@ jobs:
matrix:
include:
- os: ubuntu-latest
additional-task: ':benchmark:jvmComparisonBenchmark'
additional-task: ":benchmark:${{ github.event.pull_request.number && 'jvmPrValidationComparisonBenchmark' || 'jvmComparisonBenchmark' }}"
- os: macos-latest
additional-task: '-x :benchmark:jvmBenchmark'
additional-task: "-x :benchmark:${{ github.event.pull_request.number && 'jvmPrValidationBenchmark' || 'jvmBenchmark' }}"
- os: macos-13 # for macosX64
additional-task: '-x :benchmark:jvmBenchmark'
additional-task: "-x :benchmark:${{ github.event.pull_request.number && 'jvmPrValidationBenchmark' || 'jvmBenchmark' }}"
- os: windows-latest
additional-task: '-x :benchmark:jvmBenchmark'
additional-task: "-x :benchmark:${{ github.event.pull_request.number && 'jvmPrValidationBenchmark' || 'jvmBenchmark' }}"
runs-on: ${{ matrix.os }}
name: Run benchmarks on ${{ matrix.os }}
env:
Expand Down Expand Up @@ -89,7 +92,7 @@ jobs:
gradle-version: wrapper
- name: Run benchmarks
run: >
./gradlew --no-daemon :benchmark:benchmark ${{ matrix.additional-task }}
./gradlew --no-daemon :benchmark:${{ env.MAIN_BENCH_TASK }} ${{ matrix.additional-task }}
-Pbenchmark_warmups=${{ inputs.warmups }}
-Pbenchmark_iterations=${{ inputs.iterations }}
-Pbenchmark_iteration_time=${{ inputs.iteration-time }}
Expand Down Expand Up @@ -124,13 +127,13 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: bench-result-${{ matrix.os }}
path: ${{ env.BENCHMARK_RESULTS }}/main/**/*.json
path: ${{ env.BENCHMARK_RESULTS }}/${{ env.MAIN_BENCH_RESULTS }}/**/*.json
- name: Store comparison results as artifact
if: env.REPORT_FORMAT == 'json' && matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: bench-comparison-result-${{ matrix.os }}
path: ${{ env.BENCHMARK_RESULTS }}/comparison/**/*.json
path: ${{ env.BENCHMARK_RESULTS }}/${{ env.COMPARISON_BENCH_RESULTS }}/**/*.json

upload-benchmark-results:
if: (github.event_name == 'push' || github.event_name == 'pull_request') && github.repository == 'OptimumCode/json-schema-validator'
Expand Down
6 changes: 6 additions & 0 deletions benchmark/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,15 @@ benchmark {
getByName("main") {
include(".*Common.*Bench.*")
}
create("prValidation") {
include(".*CommonAvgTimeBench.*")
}
create("comparison") {
include(".*Comparison.*Benchmark.*")
}
create("prValidationComparison") {
include(".*ComparisonAvgTimeBenchmark.*")
}
}
targets {
register("jvm")
Expand Down
Loading