diff options
author | Joshua Haberman <joshua@reverberate.org> | 2009-08-04 22:06:02 -0700 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2009-08-04 22:06:02 -0700 |
commit | 306bc554c67c23ddd52e5ece0e3971214b2da4e7 (patch) | |
tree | 898406cd3264ee2d001d334cd2b81922cbd23330 /perf-regression-test.py | |
parent | 1733b582579927379bc04a5838add06b76ada427 (diff) |
More work on benchmarks (performance tests).
Diffstat (limited to 'perf-regression-test.py')
-rwxr-xr-x | perf-regression-test.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/perf-regression-test.py b/perf-regression-test.py new file mode 100755 index 0000000..e57955c --- /dev/null +++ b/perf-regression-test.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python +# Use to test the current working directory's performance against HEAD. + +import os + +os.system(""" +set -e +set -v + +# Generate numbers for baseline. +rm -rf perf-tmp +git clone . perf-tmp +(cd perf-tmp && ./perf-tests.sh upb) +cp perf-tmp/perf-tests.out perf-tests.baseline + +# Generate numbers for working directory. +./perf-tests.sh upb""") + +baseline = {} +baseline_file = open("perf-tests.baseline") +for line in baseline_file: + test, speed = line.split(":") + baseline[test] = int(speed) + +wd_file = open("perf-tests.out") +for line in wd_file: + test, speed = line.split(":") + baseline_val = baseline[test] + change = float(int(speed) - baseline_val) / float(baseline_val) * 100 + print "%s: %d -> %d (%f)" % (test, baseline_val, speed, change) |