From 463333809947162fb5519e2c67dd0995a3fe08dd Mon Sep 17 00:00:00 2001 From: alankritdabral <95607957+alankritdabral@users.noreply.github.com> Date: Sun, 10 Mar 2024 18:46:36 +0530 Subject: [PATCH 1/6] Create track_benchmarks.yml --- .github/workflows/track_benchmarks.yml | 40 ++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/track_benchmarks.yml diff --git a/.github/workflows/track_benchmarks.yml b/.github/workflows/track_benchmarks.yml new file mode 100644 index 0000000000..18eba57709 --- /dev/null +++ b/.github/workflows/track_benchmarks.yml @@ -0,0 +1,40 @@ +name: Track Benchmark + +on: + push: + paths-ignore: ["docs/**", "**.md"] + branches: + - main + +jobs: + track_benchmark_with_bencher: + name: Track Benchmarks with Bencher + permissions: + pull-requests: write + contents: write + runs-on: ubuntu-latest + env: + BENCHER_PROJECT: tailcall + BENCHER_TESTBED: ubuntu-latest + BENCHER_ADAPTER: json + BASE_BENCHMARK_RESULTS: benches/track_benchmark.json + steps: + - name: Check out code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Convert Cache into Proper Json + run: | + cat benches/main_benchmarks.json | jq -s 'map(select(.id and .mean and .slope and .median) | {id: .id, mean: .mean, slope: .slope, median: .median})' > benches/track_benchmark.json + + - uses: bencherdev/bencher@main + - name: Track base Benchmarks + run: | + bencher run \ + --branch 'main' \ + --token "${{ secrets.BENCHER_API_TOKEN }}" \ + --ci-id '${{ github.event.pull_request.number }}' \ + --github-actions "${{ secrets.GITHUB_TOKEN }}" \ + --err \ + --file "$BASE_BENCHMARK_RESULTS" From 554d6e00099cce89008ff84a41ceb8defef7018b Mon Sep 17 00:00:00 2001 From: alankritdabral <95607957+alankritdabral@users.noreply.github.com> Date: Sun, 10 Mar 2024 18:58:36 +0530 Subject: [PATCH 2/6] Update track_benchmarks.yml --- .github/workflows/track_benchmarks.yml | 59 +++++++++++++------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/.github/workflows/track_benchmarks.yml b/.github/workflows/track_benchmarks.yml index 18eba57709..e319952aac 100644 --- a/.github/workflows/track_benchmarks.yml +++ b/.github/workflows/track_benchmarks.yml @@ -7,34 +7,33 @@ on: - main jobs: - track_benchmark_with_bencher: - name: Track Benchmarks with Bencher - permissions: - pull-requests: write - contents: write - runs-on: ubuntu-latest - env: - BENCHER_PROJECT: tailcall - BENCHER_TESTBED: ubuntu-latest - BENCHER_ADAPTER: json - BASE_BENCHMARK_RESULTS: benches/track_benchmark.json - steps: - - name: Check out code - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} + track_benchmark_with_bencher: + name: Track Benchmarks with Bencher + permissions: + pull-requests: write + contents: write + runs-on: ubuntu-latest + env: + BENCHER_PROJECT: tailcall + BENCHER_TESTBED: ubuntu-latest + BENCHER_ADAPTER: json + BASE_BENCHMARK_RESULTS: benches/track_benchmark.json + steps: + - name: Check out code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} - - name: Convert Cache into Proper Json - run: | - cat benches/main_benchmarks.json | jq -s 'map(select(.id and .mean and .slope and .median) | {id: .id, mean: .mean, slope: .slope, median: .median})' > benches/track_benchmark.json - - - uses: bencherdev/bencher@main - - name: Track base Benchmarks - run: | - bencher run \ - --branch 'main' \ - --token "${{ secrets.BENCHER_API_TOKEN }}" \ - --ci-id '${{ github.event.pull_request.number }}' \ - --github-actions "${{ secrets.GITHUB_TOKEN }}" \ - --err \ - --file "$BASE_BENCHMARK_RESULTS" + - name: Convert Cache into Proper Json + run: | + cat benches/main_benchmarks.json | jq -s 'map(select(.id and .mean and .slope and .median) | {id: .id, mean: .mean, slope: .slope, median: .median})' > benches/track_benchmark.json + - uses: bencherdev/bencher@main + - name: Track base Benchmarks + run: | + bencher run \ + --branch 'main' \ + --token "${{ secrets.BENCHER_API_TOKEN }}" \ + --ci-id '${{ github.event.pull_request.number }}' \ + --github-actions "${{ secrets.GITHUB_TOKEN }}" \ + --err \ + --file "$BASE_BENCHMARK_RESULTS" From 02038206a5a186457b7535859930c4bfe584dd10 Mon Sep 17 00:00:00 2001 From: alankritdabral <95607957+alankritdabral@users.noreply.github.com> Date: Sun, 10 Mar 2024 21:51:30 +0530 Subject: [PATCH 3/6] Update track_benchmarks.yml --- .github/workflows/track_benchmarks.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/track_benchmarks.yml b/.github/workflows/track_benchmarks.yml index e319952aac..e850f170f7 100644 --- a/.github/workflows/track_benchmarks.yml +++ b/.github/workflows/track_benchmarks.yml @@ -16,7 +16,7 @@ jobs: env: BENCHER_PROJECT: tailcall BENCHER_TESTBED: ubuntu-latest - BENCHER_ADAPTER: json + BENCHER_ADAPTER: rust_criterion BASE_BENCHMARK_RESULTS: benches/track_benchmark.json steps: - name: Check out code @@ -27,11 +27,17 @@ jobs: - name: Convert Cache into Proper Json run: | cat benches/main_benchmarks.json | jq -s 'map(select(.id and .mean and .slope and .median) | {id: .id, mean: .mean, slope: .slope, median: .median})' > benches/track_benchmark.json - - uses: bencherdev/bencher@main + + - name: Install Bencher CLI + uses: bencherdev/bencher@main + - name: Track base Benchmarks run: | bencher run \ - --branch 'main' \ + bencher run \ + --if-branch '${{ github.event.pull_request.head.ref }}' \ + --else-if-branch '${{ github.event.pull_request.base.ref }}' \ + --else-if-branch main \ --token "${{ secrets.BENCHER_API_TOKEN }}" \ --ci-id '${{ github.event.pull_request.number }}' \ --github-actions "${{ secrets.GITHUB_TOKEN }}" \ From 9c2ff623d276e5013a247d6e406a344b47669ffd Mon Sep 17 00:00:00 2001 From: alankritdabral <95607957+alankritdabral@users.noreply.github.com> Date: Mon, 11 Mar 2024 20:50:27 +0530 Subject: [PATCH 4/6] Update track_benchmarks.yml --- .github/workflows/track_benchmarks.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/track_benchmarks.yml b/.github/workflows/track_benchmarks.yml index e850f170f7..e38055a684 100644 --- a/.github/workflows/track_benchmarks.yml +++ b/.github/workflows/track_benchmarks.yml @@ -12,28 +12,22 @@ jobs: permissions: pull-requests: write contents: write - runs-on: ubuntu-latest + runs-on: benchmarking-runner env: BENCHER_PROJECT: tailcall - BENCHER_TESTBED: ubuntu-latest + BENCHER_TESTBED: benchmarking-runner BENCHER_ADAPTER: rust_criterion - BASE_BENCHMARK_RESULTS: benches/track_benchmark.json steps: - name: Check out code uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - - name: Convert Cache into Proper Json - run: | - cat benches/main_benchmarks.json | jq -s 'map(select(.id and .mean and .slope and .median) | {id: .id, mean: .mean, slope: .slope, median: .median})' > benches/track_benchmark.json - - name: Install Bencher CLI uses: bencherdev/bencher@main - name: Track base Benchmarks run: | - bencher run \ bencher run \ --if-branch '${{ github.event.pull_request.head.ref }}' \ --else-if-branch '${{ github.event.pull_request.base.ref }}' \ @@ -42,4 +36,4 @@ jobs: --ci-id '${{ github.event.pull_request.number }}' \ --github-actions "${{ secrets.GITHUB_TOKEN }}" \ --err \ - --file "$BASE_BENCHMARK_RESULTS" + 'cargo criterion' From 538c6037aa0790c003188a4ddef753ac3502d411 Mon Sep 17 00:00:00 2001 From: alankritdabral <95607957+alankritdabral@users.noreply.github.com> Date: Mon, 11 Mar 2024 21:29:40 +0530 Subject: [PATCH 5/6] Update track_benchmarks.yml --- .github/workflows/track_benchmarks.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/track_benchmarks.yml b/.github/workflows/track_benchmarks.yml index e38055a684..088f915312 100644 --- a/.github/workflows/track_benchmarks.yml +++ b/.github/workflows/track_benchmarks.yml @@ -23,6 +23,9 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} + - name: Install rust toolchain + uses: dtolnay/rust-toolchain@stable + - name: Install Bencher CLI uses: bencherdev/bencher@main @@ -36,4 +39,4 @@ jobs: --ci-id '${{ github.event.pull_request.number }}' \ --github-actions "${{ secrets.GITHUB_TOKEN }}" \ --err \ - 'cargo criterion' + 'cargo bench' From acb9306a1a1d9d80f3a07c1258cabc8cd4b644b7 Mon Sep 17 00:00:00 2001 From: alankritdabral <95607957+alankritdabral@users.noreply.github.com> Date: Tue, 12 Mar 2024 20:22:49 +0530 Subject: [PATCH 6/6] Update track_benchmarks.yml --- .github/workflows/track_benchmarks.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/track_benchmarks.yml b/.github/workflows/track_benchmarks.yml index 088f915312..9683f3079e 100644 --- a/.github/workflows/track_benchmarks.yml +++ b/.github/workflows/track_benchmarks.yml @@ -32,11 +32,6 @@ jobs: - name: Track base Benchmarks run: | bencher run \ - --if-branch '${{ github.event.pull_request.head.ref }}' \ - --else-if-branch '${{ github.event.pull_request.base.ref }}' \ - --else-if-branch main \ --token "${{ secrets.BENCHER_API_TOKEN }}" \ - --ci-id '${{ github.event.pull_request.number }}' \ --github-actions "${{ secrets.GITHUB_TOKEN }}" \ - --err \ 'cargo bench'