Skip to content

Commit 2a7cf1b

Browse files
committed
ci/bench.sh: Benchmark masking on arm64 with QEMU
1 parent 4cc3d0e commit 2a7cf1b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

ci/bench.sh

+3
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@ go test --run=^$ --bench=. --benchmem --memprofile ci/out/prof.mem --cpuprofile
66
(
77
cd ./internal/thirdparty
88
go test --run=^$ --bench=. --benchmem --memprofile ../../ci/out/prof-thirdparty.mem --cpuprofile ../../ci/out/prof-thirdparty.cpu -o ../../ci/out/thirdparty.test "$@" .
9+
10+
GOARCH=arm64 go test -c -o ../../ci/out/thirdparty-arm64.test .
11+
qemu-aarch64 ../../ci/out/thirdparty-arm64.test --test.run=^$ --test.bench=Benchmark_mask --test.benchmem --test.memprofile ../../ci/out/prof-thirdparty-arm64.mem --test.cpuprofile ../../ci/out/prof-thirdparty-arm64.cpu .
912
)

internal/thirdparty/frame_test.go

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package thirdparty
22

33
import (
44
"encoding/binary"
5+
"runtime"
56
"strconv"
67
"testing"
78
_ "unsafe"
@@ -34,6 +35,10 @@ func nbioMaskBytes(b, key []byte) int
3435
func gorillaMaskBytes(key [4]byte, pos int, b []byte) int
3536

3637
func Benchmark_mask(b *testing.B) {
38+
b.Run(runtime.GOARCH, benchmark_mask)
39+
}
40+
41+
func benchmark_mask(b *testing.B) {
3742
sizes := []int{
3843
8,
3944
16,

0 commit comments

Comments
 (0)