Skip to content
Snippets Groups Projects
Commit 5abb0a95 authored by Dominic Kempf's avatar Dominic Kempf Committed by René Heß
Browse files

Add a script that makes performance comparisons with pandas

parent 903d730c
No related branches found
No related tags found
No related merge requests found
dune_symlink_to_source_files(FILES make_graph.sh)
dune_symlink_to_source_files(FILES make_graph.sh
performance_regression.py
)
#!/usr/bin/env python
import pandas
import subprocess
import sys
class color:
GREEN = '\033[92m'
RED = '\033[91m'
ENDC = '\033[0m'
def parse_data():
frame = pandas.read_csv('timings.csv', header=None, names=('exec', 'kernel', 'time'), delimiter=' ')
data = frame.groupby(('exec', 'kernel'))['time'].min()
return data
def run():
subprocess.call("make -j2 build_tests".split())
subprocess.call("rm timings.csv".split())
for i in range(10):
subprocess.call("ctest".split())
def regression_summary():
# Get timings
run()
data1 = parse_data()
# Switch to reference data
subprocess.call(sys.argv[1:])
# Get reference timings
run()
data2 = parse_data()
for key in data1.keys():
exe, kernel = key
diff = data1[exe][kernel] - data2[exe][kernel]
rel = abs(diff / data2[exe][kernel])
s = exe + '/' + kernel + ': ' + str(rel)
c = ''
if rel > 0.02:
if diff > 0.:
c = color.RED
else:
c = color.GREEN
print(c + s + color.ENDC)
if __name__ == '__main__':
regression_summary()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment