From 95edec7b77cc85fd073a9d4eb140f6ecf5faa357 Mon Sep 17 00:00:00 2001 From: friendseeker <66892505+Friendseeker@users.noreply.github.com> Date: Tue, 24 Sep 2024 00:10:37 -0700 Subject: [PATCH 1/2] Run AnalysisFormatBenchmark during CI --- .github/workflows/ci.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48653ce17..86b9faeec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,9 @@ jobs: - os: ubuntu-latest java: 21 jobtype: 5 + - os: ubuntu-latest + java: 21 + jobtype: 6 runs-on: ${{ matrix.os }} steps: - name: Checkout @@ -64,19 +67,29 @@ jobs: shell: bash run: | sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*Shapeless.*" "runBenchmarks" - - name: Checkout 1.10.x Branch (4, 5) + - name: Benchmark (AnalysisFormatBenchmark) (6) + if: ${{ matrix.jobtype == 6 }} + shell: bash + run: | + sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*AnalysisFormatBenchmark.*" "zincBenchmarks/Jmh/clean" "runBenchmarks" + - name: Checkout Target Branch (4, 5) if: ${{ github.event_name == 'pull_request' && (matrix.jobtype == 4 || matrix.jobtype == 5) }} uses: actions/checkout@v4 with: clean: false - ref: 1.10.x - - name: Benchmark (Scalac) against 1.10.x Branch (4) + ref: ${{ github.event.pull_request.base.ref }} + - name: Benchmark (Scalac) against Target Branch (4) if: ${{ github.event_name == 'pull_request' && matrix.jobtype == 4 }} shell: bash run: | sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*Scalac.*" "zincBenchmarks/Jmh/clean" "runBenchmarks" - - name: Benchmark (Shapeless) against 1.10.x Branch (5) + - name: Benchmark (Shapeless) against Target Branch (5) if: ${{ github.event_name == 'pull_request' && matrix.jobtype == 5 }} shell: bash run: | sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*Shapeless.*" "zincBenchmarks/Jmh/clean" "runBenchmarks" + - name: Benchmark (AnalysisFormatBenchmark) against Target Branch (6) + if: ${{ matrix.jobtype == 6 }} + shell: bash + run: | + sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*AnalysisFormatBenchmark.*" "zincBenchmarks/Jmh/clean" "runBenchmarks" From 4ecd7edee320d9314dd567f9ce681a9c1b587134 Mon Sep 17 00:00:00 2001 From: friendseeker <66892505+Friendseeker@users.noreply.github.com> Date: Thu, 26 Sep 2024 00:23:33 -0700 Subject: [PATCH 2/2] Remove text & protobuf format from benchmarking --- .github/workflows/ci.yml | 13 ++++++------- .../test/scala/xsbt/AnalysisFormatBenchmark.scala | 14 -------------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86b9faeec..43f5dc7c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,25 +71,24 @@ jobs: if: ${{ matrix.jobtype == 6 }} shell: bash run: | - sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*AnalysisFormatBenchmark.*" "zincBenchmarks/Jmh/clean" "runBenchmarks" - - name: Checkout Target Branch (4, 5) - if: ${{ github.event_name == 'pull_request' && (matrix.jobtype == 4 || matrix.jobtype == 5) }} + sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*AnalysisFormatBenchmark.*" "runBenchmarks" + - name: Checkout Target Branch (4-6) + if: ${{ github.event_name == 'pull_request' && (matrix.jobtype >= 4 || matrix.jobtype <= 6) }} uses: actions/checkout@v4 with: - clean: false ref: ${{ github.event.pull_request.base.ref }} - name: Benchmark (Scalac) against Target Branch (4) if: ${{ github.event_name == 'pull_request' && matrix.jobtype == 4 }} shell: bash run: | - sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*Scalac.*" "zincBenchmarks/Jmh/clean" "runBenchmarks" + sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*Scalac.*" "runBenchmarks" - name: Benchmark (Shapeless) against Target Branch (5) if: ${{ github.event_name == 'pull_request' && matrix.jobtype == 5 }} shell: bash run: | - sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*Shapeless.*" "zincBenchmarks/Jmh/clean" "runBenchmarks" + sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*Shapeless.*" "runBenchmarks" - name: Benchmark (AnalysisFormatBenchmark) against Target Branch (6) if: ${{ matrix.jobtype == 6 }} shell: bash run: | - sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*AnalysisFormatBenchmark.*" "zincBenchmarks/Jmh/clean" "runBenchmarks" + sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*AnalysisFormatBenchmark.*" "runBenchmarks" diff --git a/internal/zinc-benchmarks/src/test/scala/xsbt/AnalysisFormatBenchmark.scala b/internal/zinc-benchmarks/src/test/scala/xsbt/AnalysisFormatBenchmark.scala index 353a52eb3..2c219c79c 100644 --- a/internal/zinc-benchmarks/src/test/scala/xsbt/AnalysisFormatBenchmark.scala +++ b/internal/zinc-benchmarks/src/test/scala/xsbt/AnalysisFormatBenchmark.scala @@ -62,26 +62,12 @@ class AnalysisFormatBenchmark { if (temp != null) IO.delete(temp) } - @Benchmark - def readBinary(bh: Blackhole): Unit = bh.consume(readAll("", FileAnalysisStore.binary(_))) - - @Benchmark - def readText(bh: Blackhole): Unit = bh.consume(readAll("-ref-text", FileAnalysisStore.text(_))) - @Benchmark def readConsistentBinary(bh: Blackhole): Unit = bh.consume( readAll("-ref-cbin", ConsistentFileAnalysisStore.binary(_, ReadWriteMappers.getEmptyMappers)) ) - @Benchmark - def writeBinary(bh: Blackhole): Unit = - bh.consume(writeAll("-test-bin", FileAnalysisStore.binary(_), cached)) - - @Benchmark - def writeText(bh: Blackhole): Unit = - bh.consume(writeAll("-test-text", FileAnalysisStore.text(_), cached)) - @Benchmark def writeConsistentBinary(bh: Blackhole): Unit = bh.consume(