Skip to content

Commit

Permalink
add benchmark pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
jianzhangbjz committed Feb 8, 2025
1 parent 7524b4f commit 3cde584
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/benchmark.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Benchmark Test

on:
pull_request:
branches:
- main

jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Install dependencies
run: |
go mod download
- name: Run benchmark
working-directory: test/e2e
run: |
pwd
ls -la
go version
go env
go clean -testcache
go test -v -run=^$ -bench=. -benchmem -count=10
- name: Compare with baseline
run: |
go install golang.org/x/perf/cmd/benchstat@latest
benchstat benchmarks/baseline.txt new.txt
16 changes: 16 additions & 0 deletions benchmarks/baseline.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
goos: darwin
goarch: arm64
pkg: github.com/operator-framework/operator-controller/test/e2e
cpu: Apple M1 Pro
BenchmarkCreateClusterCatalog-10 1 1352852042 ns/op 404520 B/op 3914 allocs/op
BenchmarkCreateClusterCatalog-10 13 86982353 ns/op 36907 B/op 394 allocs/op
BenchmarkCreateClusterCatalog-10 12 84962496 ns/op 34555 B/op 393 allocs/op
BenchmarkCreateClusterCatalog-10 18 70375363 ns/op 34880 B/op 388 allocs/op
BenchmarkCreateClusterCatalog-10 15 71715708 ns/op 37654 B/op 399 allocs/op
BenchmarkCreateClusterCatalog-10 13 85251170 ns/op 36572 B/op 396 allocs/op
BenchmarkCreateClusterCatalog-10 13 83413260 ns/op 38435 B/op 393 allocs/op
BenchmarkCreateClusterCatalog-10 13 93851487 ns/op 37249 B/op 395 allocs/op
BenchmarkCreateClusterCatalog-10 13 78722212 ns/op 36593 B/op 393 allocs/op
BenchmarkCreateClusterCatalog-10 13 86393522 ns/op 37404 B/op 395 allocs/op
PASS
ok github.com/operator-framework/operator-controller/test/e2e 32.699s

0 comments on commit 3cde584

Please sign in to comment.