From 68a2a3eae43d7a380565eda6a7d9ccb47046f451 Mon Sep 17 00:00:00 2001 From: Gabriele Vernetti Date: Wed, 4 Sep 2024 19:19:23 +0200 Subject: [PATCH 1/3] 100 iterations to get more precise data --- benches/benches/src/sv1/criterion_sv1_benchmark.rs | 2 +- benches/benches/src/sv2/criterion_sv2_benchmark.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/benches/benches/src/sv1/criterion_sv1_benchmark.rs b/benches/benches/src/sv1/criterion_sv1_benchmark.rs index 3231a7460..ecf3fe890 100644 --- a/benches/benches/src/sv1/criterion_sv1_benchmark.rs +++ b/benches/benches/src/sv1/criterion_sv1_benchmark.rs @@ -220,7 +220,7 @@ fn benchmark_submit_serialize_deserialize_handle(c: &mut Criterion, mut client: fn main() { let mut criterion = Criterion::default() - .sample_size(50) + .sample_size(100) .measurement_time(std::time::Duration::from_secs(5)); let client = Client::new(90); benchmark_get_subscribe(&mut criterion, client.clone()); diff --git a/benches/benches/src/sv2/criterion_sv2_benchmark.rs b/benches/benches/src/sv2/criterion_sv2_benchmark.rs index 18fab853d..df54f3942 100644 --- a/benches/benches/src/sv2/criterion_sv2_benchmark.rs +++ b/benches/benches/src/sv2/criterion_sv2_benchmark.rs @@ -197,7 +197,7 @@ fn client_sv2_handle_message_common(c: &mut Criterion) { fn main() { let mut criterion = Criterion::default() - .sample_size(50) + .sample_size(100) .measurement_time(std::time::Duration::from_secs(5)); client_sv2_setup_connection(&mut criterion); client_sv2_setup_connection_serialize(&mut criterion); From b848e71744846887c7944183eeb4570e00a80d24 Mon Sep 17 00:00:00 2001 From: Gabriele Vernetti Date: Wed, 4 Sep 2024 19:19:39 +0200 Subject: [PATCH 2/3] Update bencher workflow executions --- .github/workflows/run-benchmarks.yaml | 1 - .github/workflows/track-benchmarks.yaml | 20 ++++++++------------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/run-benchmarks.yaml b/.github/workflows/run-benchmarks.yaml index 150188218..feec5a5e6 100644 --- a/.github/workflows/run-benchmarks.yaml +++ b/.github/workflows/run-benchmarks.yaml @@ -4,7 +4,6 @@ on: pull_request: branches: - main - - dev jobs: benchmark_sv1_criterion: diff --git a/.github/workflows/track-benchmarks.yaml b/.github/workflows/track-benchmarks.yaml index 1a81de933..6a10112d0 100644 --- a/.github/workflows/track-benchmarks.yaml +++ b/.github/workflows/track-benchmarks.yaml @@ -62,9 +62,8 @@ jobs: - name: Track Benchmarks with Bencher run: | bencher run \ - --if-branch '${{ env.PR_HEAD }}' \ - --else-if-branch '${{ env.PR_BASE }}' \ - --else-if-branch '${{ env.PR_DEFAULT }}' \ + --branch-start-point main \ + --branch-reset \ --ci-number '${{ env.PR_NUMBER }}' \ --github-actions "${{ secrets.GITHUB_TOKEN }}" \ --token "${{ secrets.BENCHER_API_TOKEN }}" \ @@ -126,9 +125,8 @@ jobs: - name: Track Benchmarks with Bencher run: | bencher run \ - --if-branch '${{ env.PR_HEAD }}' \ - --else-if-branch '${{ env.PR_BASE }}' \ - --else-if-branch '${{ env.PR_DEFAULT }}' \ + --branch-start-point main \ + --branch-reset \ --ci-number '${{ env.PR_NUMBER }}' \ --github-actions "${{ secrets.GITHUB_TOKEN }}" \ --token "${{ secrets.BENCHER_API_TOKEN }}" \ @@ -190,9 +188,8 @@ jobs: - name: Track Benchmarks with Bencher run: | bencher run \ - --if-branch '${{ env.PR_HEAD }}' \ - --else-if-branch '${{ env.PR_BASE }}' \ - --else-if-branch '${{ env.PR_DEFAULT }}' \ + --branch-start-point main \ + --branch-reset \ --ci-number '${{ env.PR_NUMBER }}' \ --github-actions "${{ secrets.GITHUB_TOKEN }}" \ --token "${{ secrets.BENCHER_API_TOKEN }}" \ @@ -254,9 +251,8 @@ jobs: - name: Track Benchmarks with Bencher run: | bencher run \ - --if-branch '${{ env.PR_HEAD }}' \ - --else-if-branch '${{ env.PR_BASE }}' \ - --else-if-branch '${{ env.PR_DEFAULT }}' \ + --branch-start-point main \ + --branch-reset \ --ci-number '${{ env.PR_NUMBER }}' \ --github-actions "${{ secrets.GITHUB_TOKEN }}" \ --token "${{ secrets.BENCHER_API_TOKEN }}" \ From ed7dbdc005d830243347f28066d9a1e7f39c61c7 Mon Sep 17 00:00:00 2001 From: Gabriele Vernetti Date: Wed, 4 Sep 2024 21:39:41 +0200 Subject: [PATCH 3/3] Set branch-start-point to base branch (main) --- .github/workflows/track-benchmarks.yaml | 30 ++++++++++++++++--------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/.github/workflows/track-benchmarks.yaml b/.github/workflows/track-benchmarks.yaml index 6a10112d0..1b088ad8a 100644 --- a/.github/workflows/track-benchmarks.yaml +++ b/.github/workflows/track-benchmarks.yaml @@ -56,13 +56,15 @@ jobs: let prEvent = JSON.parse(fs.readFileSync(process.env.PR_EVENT, {encoding: 'utf8'})); core.exportVariable("PR_HEAD", `${prEvent.number}/merge`); core.exportVariable("PR_BASE", prEvent.pull_request.base.ref); - core.exportVariable("PR_DEFAULT", prEvent.pull_request.base.repo.default_branch); + core.exportVariable("PR_BASE_SHA", prEvent.pull_request.base.sha); core.exportVariable("PR_NUMBER", prEvent.number); - uses: bencherdev/bencher@main - name: Track Benchmarks with Bencher run: | bencher run \ - --branch-start-point main \ + --branch '${{ env.PR_HEAD }}' \ + --branch-start-point '${{ env.PR_BASE }}' \ + --branch-start-point-hash '${{ env.PR_BASE_SHA }}' \ --branch-reset \ --ci-number '${{ env.PR_NUMBER }}' \ --github-actions "${{ secrets.GITHUB_TOKEN }}" \ @@ -117,15 +119,17 @@ jobs: script: | let fs = require('fs'); let prEvent = JSON.parse(fs.readFileSync(process.env.PR_EVENT, {encoding: 'utf8'})); - core.exportVariable("PR_HEAD", prEvent.pull_request.head.ref); + core.exportVariable("PR_HEAD", `${prEvent.number}/merge`); core.exportVariable("PR_BASE", prEvent.pull_request.base.ref); - core.exportVariable("PR_DEFAULT", prEvent.pull_request.base.repo.default_branch); + core.exportVariable("PR_BASE_SHA", prEvent.pull_request.base.sha); core.exportVariable("PR_NUMBER", prEvent.number); - uses: bencherdev/bencher@main - name: Track Benchmarks with Bencher run: | bencher run \ - --branch-start-point main \ + --branch '${{ env.PR_HEAD }}' \ + --branch-start-point '${{ env.PR_BASE }}' \ + --branch-start-point-hash '${{ env.PR_BASE_SHA }}' \ --branch-reset \ --ci-number '${{ env.PR_NUMBER }}' \ --github-actions "${{ secrets.GITHUB_TOKEN }}" \ @@ -180,15 +184,17 @@ jobs: script: | let fs = require('fs'); let prEvent = JSON.parse(fs.readFileSync(process.env.PR_EVENT, {encoding: 'utf8'})); - core.exportVariable("PR_HEAD", prEvent.pull_request.head.ref); + core.exportVariable("PR_HEAD", `${prEvent.number}/merge`); core.exportVariable("PR_BASE", prEvent.pull_request.base.ref); - core.exportVariable("PR_DEFAULT", prEvent.pull_request.base.repo.default_branch); + core.exportVariable("PR_BASE_SHA", prEvent.pull_request.base.sha); core.exportVariable("PR_NUMBER", prEvent.number); - uses: bencherdev/bencher@main - name: Track Benchmarks with Bencher run: | bencher run \ - --branch-start-point main \ + --branch '${{ env.PR_HEAD }}' \ + --branch-start-point '${{ env.PR_BASE }}' \ + --branch-start-point-hash '${{ env.PR_BASE_SHA }}' \ --branch-reset \ --ci-number '${{ env.PR_NUMBER }}' \ --github-actions "${{ secrets.GITHUB_TOKEN }}" \ @@ -243,15 +249,17 @@ jobs: script: | let fs = require('fs'); let prEvent = JSON.parse(fs.readFileSync(process.env.PR_EVENT, {encoding: 'utf8'})); - core.exportVariable("PR_HEAD", prEvent.pull_request.head.ref); + core.exportVariable("PR_HEAD", `${prEvent.number}/merge`); core.exportVariable("PR_BASE", prEvent.pull_request.base.ref); - core.exportVariable("PR_DEFAULT", prEvent.pull_request.base.repo.default_branch); + core.exportVariable("PR_BASE_SHA", prEvent.pull_request.base.sha); core.exportVariable("PR_NUMBER", prEvent.number); - uses: bencherdev/bencher@main - name: Track Benchmarks with Bencher run: | bencher run \ - --branch-start-point main \ + --branch '${{ env.PR_HEAD }}' \ + --branch-start-point '${{ env.PR_BASE }}' \ + --branch-start-point-hash '${{ env.PR_BASE_SHA }}' \ --branch-reset \ --ci-number '${{ env.PR_NUMBER }}' \ --github-actions "${{ secrets.GITHUB_TOKEN }}" \