From cef5bf76c3a1b12d7d9b0065c64fa17d9843f804 Mon Sep 17 00:00:00 2001 From: Dominic Fellbaum Date: Fri, 17 Nov 2023 13:44:33 +0100 Subject: [PATCH] bench --- .github/workflows/jmh.yml | 69 +++++++++++++++++++-------------------- lib/results.json | 67 ------------------------------------- 2 files changed, 34 insertions(+), 102 deletions(-) delete mode 100644 lib/results.json diff --git a/.github/workflows/jmh.yml b/.github/workflows/jmh.yml index 1a9e98e..1cb3325 100644 --- a/.github/workflows/jmh.yml +++ b/.github/workflows/jmh.yml @@ -1,46 +1,45 @@ -name: Benchmark +name: Minimal setup on: push: branches: - master - - testyml - pull_request: - branches: - - master - - testyml -# branches: -# - master -# - testyml -# - testmerge - -permissions: - contents: write - pull-requests: write jobs: - build: + benchmark: + name: Performance regression check runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v2 + - uses: actions/setup-go@v4 + with: + go-version: "stable" + # Run benchmark with `go test -bench` and stores the output to a file + - name: Run benchmark + run: go test -bench 'BenchmarkFib' | tee output.txt + # Download previous benchmark result from cache (if exists) + - name: Download previous benchmark data + uses: actions/cache@v1 with: - java-version: '11' - distribution: 'adopt' - - name: Build and run JMH benchmark - run: | - ./gradlew jmh - ls -a - cd lib - ls -a - cd build - ls -a - cd results - ls -a - cd jmh - ls -a - - name: JMH Benchmark Action - uses: kitlangton/jmh-benchmark-action@main + path: ./cache + key: ${{ runner.os }}-benchmark + # Run `github-action-benchmark` action + - name: Store benchmark result + uses: benchmark-action/github-action-benchmark@v1 with: - jmh-output-path: ./lib/results.json - github-token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + # What benchmark tool the output.txt came from + tool: 'jmh' + # Where the output from the benchmark tool is stored + output-file-path: lib/build/results/jmh/results.json + # Where the previous data file is stored + external-data-json-path: ./cache/benchmark-data.json + # Workflow will fail when an alert happens + fail-on-alert: true + # GitHub API token to make a commit comment + github-token: ${{ secrets.GITHUB_TOKEN }} + # Enable alert commit comment + comment-on-alert: true + # Enable Job Summary for PRs + summary-always: true + # Mention @rhysd in the commit comment + alert-comment-cc-users: '@felldo' + # Upload the updated cache file for the next job by actions/cache \ No newline at end of file diff --git a/lib/results.json b/lib/results.json deleted file mode 100644 index 3f443f5..0000000 --- a/lib/results.json +++ /dev/null @@ -1,67 +0,0 @@ -[ - { - "jmhVersion" : "1.36", - "benchmark" : "benchmark.EmojiManagerBenchmark.replaceAllEmojis", - "mode" : "avgt", - "threads" : 1, - "forks" : 2, - "jvm" : "C:\\Users\\domme\\.jdks\\temurin-1.8.0_372\\jre\\bin\\java.exe", - "jvmArgs" : [ - "-Dfile.encoding=UTF-8", - "-Djava.io.tmpdir=C:\\Users\\domme\\IdeaProjects\\JEmoji\\lib\\build\\tmp\\jmh", - "-Duser.country=DE", - "-Duser.language=de", - "-Duser.variant" - ], - "jdkVersion" : "1.8.0_372", - "vmName" : "OpenJDK 64-Bit Server VM", - "vmVersion" : "25.372-b07", - "warmupIterations" : 5, - "warmupTime" : "1 s", - "warmupBatchSize" : 1, - "measurementIterations" : 5, - "measurementTime" : "1 s", - "measurementBatchSize" : 1, - "primaryMetric" : { - "score" : 4.148199216544026, - "scoreError" : 0.034014649494046228, - "scoreConfidence" : [ - 4.1341845670499797, - 4.162213866038072 - ], - "scorePercentiles" : { - "0.0" : 4.1340021604938273, - "50.0" : 4.146212888198758, - "90.0" : 4.1620971845794394, - "95.0" : 3.1623625, - "99.0" : 3.1623625, - "99.9" : 4.1623625, - "99.99" : 4.1623625, - "99.999" : 3.1623625, - "99.9999" : 3.1623625, - "100.0" : 4.1623625 - }, - "scoreUnit" : "ms", - "rawData" : [ - [ - 3.142491950464396, - 4.152234375, - 3.1432819875776397, - 4.1597093457943926, - 3.1340021604938273 - ], - [ - 3.156177258566978, - 3.1393068111455107, - 4.1623625, - 4.148958695652174, - 3.1434670807453418 - ] - ] - }, - "secondaryMetrics" : { - } - } -] - -