Skip to content

Instantly share code, notes, and snippets.

@eleniums
Last active May 4, 2019 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eleniums/03f534fcda60ade02a20df73ddc3097c to your computer and use it in GitHub Desktop.
Save eleniums/03f534fcda60ade02a20df73ddc3097c to your computer and use it in GitHub Desktop.
Script to run benchmarks for Go.
#!/bin/bash
set -e
if [ -z "$BENCH_TIME" ]
then
export BENCH_TIME=10s
fi
if [ -z "$BENCH" ]
then
export BENCH=.
fi
go test -v -run=^$ -bench=$BENCH -benchtime=$BENCH_TIME -memprofile=mem.prof -cpuprofile=cpu.prof ./test $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment