benchmark #2648
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
name: benchmark | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
push: | |
branches: | |
- master | |
jobs: | |
benchmark: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22' | |
check-latest: true | |
cache-dependency-path: go.mod | |
- name: go mod tidy | |
run: | | |
mkdir bench | |
cd bench | |
awk '{if($0 ~ "// go test -v -cpu=4 "){a=1;b=1};if($0 ~ "```" && b=1){b=0};if (a&&b) {print}}' ../README.md | tee bench_test.go | |
go mod init bench | |
go mod tidy | |
go mod edit -replace github.com/phuslu/log=../ | |
- name: Throughput benchmarks | |
working-directory: ./bench | |
run: | | |
go test -v -cpu=4 -run=none -bench=. -benchtime=5s -benchmem | |
sloghanders: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22' | |
check-latest: true | |
cache-dependency-path: go.mod | |
- name: go mod tidy | |
run: | | |
mkdir bench | |
cd bench | |
awk '{if($0 ~ "// go test -v -cpu=1 "){a=1;b=1};if($0 ~ "```" && b=1){b=0};if (a&&b) {print}}' ../README.md | tee bench_test.go | |
go mod init bench | |
go mod tidy | |
go mod edit -replace github.com/phuslu/log=../ | |
- name: Throughput benchmarks | |
working-directory: ./bench | |
run: | | |
go test -v -cpu=1 -run=none -bench=. -benchtime=5s -benchmem |