parent
1733b58257
commit
306bc554c6
8 changed files with 103 additions and 23 deletions
@ -1 +1 @@ |
||||
-DNDEBUG -fomit-frame-pointer |
||||
-DNDEBUG -fomit-frame-pointer -msse3 |
||||
|
@ -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) |
@ -0,0 +1,34 @@ |
||||
#!/bin/sh |
||||
# Builds and runs all available benchmarks. The tree will be built |
||||
# multiple times with a few different compiler flag combinations. |
||||
# The output will be dumped to stdout and to perf-tests.out. |
||||
|
||||
MAKETARGET=benchmarks |
||||
if [ x$1 == xupb ]; then |
||||
MAKETARGET=upb_benchmarks |
||||
fi |
||||
|
||||
rm -f perf-tests.out |
||||
|
||||
make clean |
||||
echo "-DNDEBUG -msse3" > perf-cppflags |
||||
make $MAKETARGET |
||||
make benchmark | sed -e 's/^/plain./g' | tee -a perf-tests.out |
||||
|
||||
make clean |
||||
echo "-DNDEBUG -fomit-frame-pointer -msse3" > perf-cppflags |
||||
make $MAKETARGET |
||||
make benchmark | sed -e 's/^/omitfp./g' | tee -a perf-tests.out |
||||
|
||||
if [ x`uname -m` == xx86_64 ]; then |
||||
make clean |
||||
echo "-DNDEBUG -msse3 -m32" > perf-cppflags |
||||
make upb_benchmarks |
||||
make benchmark | sed -e 's/^/plain32./g' | tee -a perf-tests.out |
||||
|
||||
make clean |
||||
echo "-DNDEBUG -fomit-frame-pointer -msse3 -m32" > perf-cppflags |
||||
make upb_benchmarks |
||||
make benchmark | sed -e 's/^/omitfp32./g' | tee -a perf-tests.out |
||||
fi |
||||
|
Loading…
Reference in new issue