http urls monitor.

benchmark.sh 874B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. set -e
  3. reference_ref=${1:-master}
  4. reference_git=${2:-.}
  5. if ! `hash benchstat 2>/dev/null`; then
  6. echo "Installing benchstat"
  7. go get golang.org/x/perf/cmd/benchstat
  8. go install golang.org/x/perf/cmd/benchstat
  9. fi
  10. tempdir=`mktemp -d /tmp/go-toml-benchmark-XXXXXX`
  11. ref_tempdir="${tempdir}/ref"
  12. ref_benchmark="${ref_tempdir}/benchmark-`echo -n ${reference_ref}|tr -s '/' '-'`.txt"
  13. local_benchmark="`pwd`/benchmark-local.txt"
  14. echo "=== ${reference_ref} (${ref_tempdir})"
  15. git clone ${reference_git} ${ref_tempdir} >/dev/null 2>/dev/null
  16. pushd ${ref_tempdir} >/dev/null
  17. git checkout ${reference_ref} >/dev/null 2>/dev/null
  18. go test -bench=. -benchmem | tee ${ref_benchmark}
  19. popd >/dev/null
  20. echo ""
  21. echo "=== local"
  22. go test -bench=. -benchmem | tee ${local_benchmark}
  23. echo ""
  24. echo "=== diff"
  25. benchstat -delta-test=none ${ref_benchmark} ${local_benchmark}