From 59ca64de5bace6adf289a2b4c34798f7c9780dc1 Mon Sep 17 00:00:00 2001 From: Daniel Lin Date: Fri, 1 Dec 2023 07:12:24 -0500 Subject: [PATCH] Add benchmarks --- .github/workflows/kt-bench.yml | 113 ++++++++++++++++++++++++++++++++ kt/aoc2023-exe/build.gradle.kts | 7 ++ 2 files changed, 120 insertions(+) create mode 100644 .github/workflows/kt-bench.yml diff --git a/.github/workflows/kt-bench.yml b/.github/workflows/kt-bench.yml new file mode 100644 index 00000000..94896662 --- /dev/null +++ b/.github/workflows/kt-bench.yml @@ -0,0 +1,113 @@ +name: Kotlin benchmarks + +on: + workflow_dispatch: + +permissions: + contents: write + +jobs: + get-inputs: + uses: ephemient/aoc2023/.github/workflows/get-inputs.yml@main + secrets: + SESSION: ${{ secrets.SESSION }} + + jmh-visualizer: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + repository: jzillmann/jmh-visualizer + - uses: actions/setup-node@v3 + with: + node-version: 18 + cache: npm + - run: npm install + - run: npm run providedZip + env: + NODE_OPTIONS=--openssl-legacy-provider + - uses: actions/upload-artifact@v3 + with: + name: jmh-visualizer + path: jmh-visualizer.zip + + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v3 + with: + name: inputs + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + - uses: gradle/gradle-build-action@v2 + with: + arguments: assembleBenchmarks + build-root-directory: kt + - uses: actions/upload-artifact@v3 + with: + name: jvmBench + path: kt/aoc2023-exe/build/benchmarks/*/jars/*.jar + + run: + needs: [ get-inputs, jmh-visualizer, build ] + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + ref: gh-docs + - uses: actions/download-artifact@v3 + with: + name: inputs + path: inputs + - uses: actions/download-artifact@v3 + with: + name: jmh-visualizer + - uses: actions/download-artifact@v3 + with: + name: jvmBench + - run: rm -rf jmh-visualizer + - run: unzip -d jmh-visualizer jmh-visualizer.zip + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + - name: Run JVM benchmarks + run: | + cat >config <jmh-visualizer/provided.js <