File tree Expand file tree Collapse file tree 2 files changed +28
-3
lines changed
Expand file tree Collapse file tree 2 files changed +28
-3
lines changed Original file line number Diff line number Diff line change 1+ name : Go
2+
3+ on :
4+ push :
5+ branches :
6+ - ' main'
7+
8+ jobs :
9+ benchmark :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - uses : actions/checkout@v2
13+
14+ - name : Setup Go
15+ uses : actions/setup-go@v2
16+ with :
17+ go-version : 1.18.x
18+
19+ - name : Run benchmarks
20+ run : |
21+ go install golang.org/x/perf/cmd/benchstat@latest
22+ make benchcmp count=1
Original file line number Diff line number Diff line change 1+ SHELL = /bin/bash
2+
13dstdir := $(CURDIR )
24srcdir := $(CURDIR ) /build
35
@@ -16,10 +18,11 @@ build: $(targets)
1618
1719count ?= 5
1820bench ?= .
21+ pkg ?= ...
1922benchcmp :
20- go test -v -run _ -count $(count ) -bench $(bench ) ./$(pkg ) -tags purego | tee /tmp/bench-$(pkg ) -purego.txt
21- go test -v -run _ -count $(count ) -bench $(bench ) ./$(pkg ) | tee /tmp/bench-$(pkg ) -asm.txt
22- benchstat /tmp/bench-$(pkg ) -{purego,asm}.txt
23+ go test -v -run _ -count $(count ) -bench $(bench ) ./$(pkg ) -tags purego > /tmp/bench-$(subst .,dot, $( pkg ) ) -purego.txt
24+ go test -v -run _ -count $(count ) -bench $(bench ) ./$(pkg ) > /tmp/bench-$(subst .,dot, $( pkg ) ) -asm.txt
25+ benchstat /tmp/bench-$(subst .,dot, $( pkg ) ) -{purego,asm}.txt
2326
2427$(dstdir ) /% _amd64.s $(dstdir ) /% _amd64.go : $(srcdir ) /% _asm.go $(internal )
2528 cd build && go run $(patsubst $(CURDIR ) /build/% ,% ,$< ) \
You can’t perform that action at this time.
0 commit comments