-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
action for benchmarking detectors (#590)
* add action for benchmarking each detector
- Loading branch information
1 parent
fd16da2
commit 458b62d
Showing
4 changed files
with
34 additions
and
76 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Run benchmarks | ||
on: | ||
pull_request: | ||
branches: [master] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
benchmark: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Base for comparison is master branch. | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
with: | ||
ref: master | ||
- name: Install Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version-file: 'go.mod' | ||
|
||
# 30 runs with 100ms benchtime seems to result in acceptable p-values | ||
# When I tried with count=10, it would be unreliable because of the actions | ||
# runner is in a shared environment and CPU and mem would be affected by others. (or so I think) | ||
- run: go test -run=none -bench=. -count=30 -benchtime=100ms -timeout=20m > /tmp/prev | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
- run: go test -run=none -bench=. -count=30 -benchtime=100ms -timeout=20m > /tmp/curr | ||
|
||
- run: go install golang.org/x/perf/cmd/benchstat@latest | ||
- run: benchstat /tmp/prev /tmp/curr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,10 +24,7 @@ jobs: | |
version: "v1.58" | ||
|
||
test: | ||
strategy: | ||
matrix: | ||
platform: [ubuntu-latest, windows-latest] | ||
runs-on: ${{ matrix.platform }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters