6 ["net/http"]="net/http"
7 ["image/color"]="image/color"
9 ["k8s"]="k8s.io/kubernetes/pkg/..."
20 BIN=$(realpath ./silent-staticcheck.sh)
29 if [ $wipe -ne 0 ]; then
30 rm -rf ~/.cache/staticcheck
33 local out=$(GOGC=$gc GOMAXPROCS=$cores env time -f "%e %M" $BIN $pkg 2>&1)
34 local t=$(echo "$out" | cut -f1 -d" ")
35 local m=$(echo "$out" | cut -f2 -d" ")
36 local ns=$(printf "%s 1000000000 * p" $t | dc)
41 printf "BenchmarkStaticcheck-%s-GOGC%d-wiped%d-%d 1 %.0f ns/op %.0f B/op\n" "$label" "$gc" "$wipe" "$cores" "$ns" "$b"
44 printf "%s,%d,%d,%d,%.0f,%.0f\n" "$label" "$gc" "$cores" "$wipe" "$ns" "$b"
49 export GO111MODULE=off
51 if [ "$FORMAT" = "csv" ]; then
52 printf "packages,gogc,gomaxprocs,wipe-cache,time,memory\n"
55 for label in "${!PKGS[@]}"; do
57 for gc in $(seq $MIN_GOGC 10 $MAX_GOGC); do
58 for cores in $(seq $MIN_CORES $INCR_CORES $MAX_CORES); do
59 for i in $(seq 1 $SAMPLES); do
60 runBenchmark "$pkg" "$label" "$gc" "$cores" 1
61 runBenchmark "$pkg" "$label" "$gc" "$cores" 0