File: bench.sh

package info (click to toggle)
golang-nhooyr-websocket 1.8.12-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 528 kB
  • sloc: asm: 158; sh: 101; javascript: 62; makefile: 6
file content (20 lines) | stat: -rwxr-xr-x 662 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
set -eu
cd -- "$(dirname "$0")/.."

go test --run=^$ --bench=. --benchmem "$@" ./...
# For profiling add: --memprofile ci/out/prof.mem --cpuprofile ci/out/prof.cpu -o ci/out/websocket.test
(
  cd ./internal/thirdparty
  go test --run=^$ --bench=. --benchmem "$@" .

  GOARCH=arm64 go test -c -o ../../ci/out/thirdparty-arm64.test "$@" .
  if [ "$#" -eq 0 ]; then
    if [ "${CI-}" ]; then
      sudo apt-get update
      sudo apt-get install -y qemu-user-static
	  ln -s /usr/bin/qemu-aarch64-static /usr/local/bin/qemu-aarch64
    fi
    qemu-aarch64 ../../ci/out/thirdparty-arm64.test --test.run=^$ --test.bench=Benchmark_mask --test.benchmem
  fi
)