Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
Merge pull request #61 from mjs/perfcheck-tweaks
Browse files Browse the repository at this point in the history
perfcheck tweaks
  • Loading branch information
mjs authored Apr 4, 2018
2 parents 1c065ba + 340aebe commit 4c5d1a8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 25 deletions.
12 changes: 5 additions & 7 deletions benchcheck/benchcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,16 @@ func main() {
log.Fatal(err)
}

if hasProblem {
fmt.Println("Performance regression found!")
fmt.Println()
printTables(tables)
} else if *flagPrint {
if hasProblem || *flagPrint {
printTables(tables)
} else {
fmt.Println("No performance regressions found")
}
fmt.Println()

if hasProblem {
fmt.Println("Performance regression found!")
os.Exit(1)
} else {
fmt.Println("No performance regressions found.")
}
}

Expand Down
42 changes: 24 additions & 18 deletions perfcheck
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
GO_PACKAGE=github.com/jumptrading/influx-spout
REFERENCE_REVISION=${REFERENCE_REVISION:-aa46d4677bb8ef72848c211312d9051b879322dc}

iterations=5
max_attempts=3
iterations=3
orig_gopath=$GOPATH

echo "Comparing working tree against $REFERENCE_REVISION"
Expand Down Expand Up @@ -70,25 +71,30 @@ git checkout --quiet -b perfcheck $REFERENCE_REVISION > /dev/null
popd > /dev/null
set +e

# Remove output from previous runs
rm -f $reference_bench_output $current_bench_output

# Run the tests for the current benchmarks and reference benchmarks
# $iterations times. The runs are interleaved to minimise the effects
# of other load on the host.
for i in `seq $iterations`; do
title "Iteration $i/$iterations"

title "Running current benchmarks"
export GOPATH=$orig_gopath
capture_benchmarks "$test_sizes" $current_bench_output

title "Running reference benchmarks"
export GOPATH=$ref_gopath
pushd $clone_dir > /dev/null
capture_benchmarks "$test_sizes" $reference_bench_output
popd > /dev/null
done
for a in `seq $max_attempts`; do
title "Attempt $a ($max_attempts max)"

# Remove output from previous runs
rm -f $reference_bench_output $current_bench_output

for i in `seq $iterations`; do
title "Iteration $i/$iterations"

title "Comparing benchmarks"
./benchcheck/benchcheck $reference_bench_output $current_bench_output
title "Running current benchmarks"
export GOPATH=$orig_gopath
capture_benchmarks "$test_sizes" $current_bench_output

title "Running reference benchmarks"
export GOPATH=$ref_gopath
pushd $clone_dir > /dev/null
capture_benchmarks "$test_sizes" $reference_bench_output
popd > /dev/null
done

title "Comparing benchmarks"
./benchcheck/benchcheck -print $reference_bench_output $current_bench_output && exit 0
done

0 comments on commit 4c5d1a8

Please sign in to comment.