Skip to content

ci: add benchmark comparison job for PR regression detection#21082

Draft
lvalerom wants to merge 10 commits into
masterfrom
lvm/bench-script-test
Draft

ci: add benchmark comparison job for PR regression detection#21082
lvalerom wants to merge 10 commits into
masterfrom
lvm/bench-script-test

Conversation

@lvalerom

Copy link
Copy Markdown
Contributor

Description

Adds a CI job that automatically compares Go benchmark results between a PR and its base branch. When a PR touches packages that contain benchmarks, the job runs them on both refs using git worktrees, compares with benchstat, and posts results as a PR comment.

  • scripts/bench-compare.sh — local script that detects changed packages, runs benchmarks on both refs, compares with benchstat
  • go-bench-compare job in unit-tests.yaml — CI wrapper that calls the script and posts results

The job is non-blocking (continue-on-error: true) and only runs on PRs.

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

Tested the script locally by introducing an artificial regression (adding a mutex to ValueStream.Push) and running scripts/bench-compare.sh. The script correctly detected the regression with benchstat showing +78.82% (p=0.008) on BenchmarkValueStreamWrite.

@openshift-ci

openshift-ci Bot commented Jun 11, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 066cdabb-eee7-49c0-a340-6d6a7ab34f24

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch lvm/bench-script-test

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

lvalerom and others added 2 commits June 11, 2026 13:30
Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

🚀 Build Images Ready

Images are ready for commit b3bf259. To use with deploy scripts:

export MAIN_IMAGE_TAG=4.12.x-161-gb3bf259bb5

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Benchmark Comparison

go: 
goos: linux
goarch: amd64
pkg: github.com/stackrox/rox/pkg/concurrency
cpu: AMD EPYC 7763 64-Core Processor                
                       │     head      │
                       │    sec/op     │
KeyFence-4               13.88µ ±  70%
ValueStreamWrite-4       976.5n ±  48%
BufChanWrite-4           531.0n ±  17%
Buf1ChanWrite-4          470.5n ±  11%
UnbufChanWrite-4         2.760µ ±  21%
SliceAppend-4            301.0n ±  10%
SliceAppendWithMutex-4   1.167µ ±  20%
ValueStreamRead-4        8.647µ ±  78%
ValueStreamReadAsync-4   2.234µ ± 157%
BufChanRead-4            1.448µ ±  31%
Buf1ChanRead-4           2.750µ ±  77%
UnbufChanRead-4          3.081µ ±  67%
SliceRead-4              265.5n ±  13%
SliceReadWithMutex-4     1.202µ ±  22%
geomean                  1.483µ

                       │       head       │
                       │       B/op       │
KeyFence-4               5.469Ki ± 112%
ValueStreamWrite-4         136.0 ±   0%
BufChanWrite-4             0.000 ±   0%
Buf1ChanWrite-4            0.000 ±   0%
UnbufChanWrite-4           0.000 ±   0%
SliceAppend-4              0.000 ±   0%
SliceAppendWithMutex-4     0.000 ±   0%
ValueStreamRead-4          112.0 ±   0%
ValueStreamReadAsync-4     112.0 ± 121%
BufChanRead-4              112.0 ±   0%
Buf1ChanRead-4             112.0 ±   0%
UnbufChanRead-4            112.0 ±   0%
SliceRead-4                0.000 ±   0%
SliceReadWithMutex-4       0.000 ±   0%
geomean                                 ¹
¹ summaries must be >0 to compute geomean

                       │      head      │
                       │   allocs/op    │
KeyFence-4               40.50 ±  41%
ValueStreamWrite-4       2.000 ±   0%
BufChanWrite-4           0.000 ±   0%
Buf1ChanWrite-4          0.000 ±   0%
UnbufChanWrite-4         0.000 ±   0%
SliceAppend-4            0.000 ±   0%
SliceAppendWithMutex-4   0.000 ±   0%
ValueStreamRead-4        1.000 ±   0%
ValueStreamReadAsync-4   1.000 ± 200%
BufChanRead-4            1.000 ±   0%
Buf1ChanRead-4           1.000 ±   0%
UnbufChanRead-4          1.000 ±   0%
SliceRead-4              0.000 ±   0%
SliceReadWithMutex-4     0.000 ±   0%
geomean                               ¹
¹ summaries must be >0 to compute geomean

go: downloading github.com/stackrox/yaml/v3 v3.0.0
                       │     base      │
                       │    sec/op     │
KeyFence-4               10.00µ ± 224%
ValueStreamWrite-4       1.337µ ±  12%
BufChanWrite-4           491.0n ±  14%
Buf1ChanWrite-4          476.0n ±  22%
UnbufChanWrite-4         2.209µ ±  17%
SliceAppend-4            271.0n ±  18%
SliceAppendWithMutex-4   1.282µ ±  17%
ValueStreamRead-4        9.323µ ±  26%
ValueStreamReadAsync-4   3.978µ ±  56%
BufChanRead-4            1.443µ ±  37%
Buf1ChanRead-4           3.361µ ±  39%
UnbufChanRead-4          3.406µ ±  31%
SliceRead-4              295.0n ±  22%
SliceReadWithMutex-4     1.177µ ±  11%
geomean                  1.561µ

                       │       base       │
                       │       B/op       │
KeyFence-4               4.922Ki ± 139%
ValueStreamWrite-4         136.0 ±   0%
BufChanWrite-4             0.000 ±   0%
Buf1ChanWrite-4            0.000 ±   0%
UnbufChanWrite-4           0.000 ±    ?
SliceAppend-4              0.000 ±   0%
SliceAppendWithMutex-4     0.000 ±   0%
ValueStreamRead-4          112.0 ±   0%
ValueStreamReadAsync-4     248.0 ±  55%
BufChanRead-4              112.0 ±   0%
Buf1ChanRead-4             112.0 ±   0%
UnbufChanRead-4            112.0 ±   0%
SliceRead-4                0.000 ±   0%
SliceReadWithMutex-4       0.000 ±   0%
geomean                                 ¹
¹ summaries must be >0 to compute geomean

                       │     base      │
                       │   allocs/op   │
KeyFence-4               39.50 ± 59%
ValueStreamWrite-4       2.000 ±  0%
BufChanWrite-4           0.000 ±  0%
Buf1ChanWrite-4          0.000 ±  0%
UnbufChanWrite-4         0.000 ±   ?
SliceAppend-4            0.000 ±  0%
SliceAppendWithMutex-4   0.000 ±  0%
ValueStreamRead-4        1.000 ±  0%
ValueStreamReadAsync-4   3.000 ± 67%
BufChanRead-4            1.000 ±  0%
Buf1ChanRead-4           1.000 ±  0%
UnbufChanRead-4          1.000 ±  0%
SliceRead-4              0.000 ±  0%
SliceReadWithMutex-4     0.000 ±  0%
geomean                              ¹
¹ summaries must be >0 to compute geomean

lvalerom and others added 6 commits June 11, 2026 13:45
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant