From 882e173a2cc9a09c3a96a330f981daa11e34e0d0 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Sat, 2 Oct 2021 14:11:14 +0200 Subject: Updated benchmark scripts. --- benchmarks/plot.py | 9 ++++++--- benchmarks/run_all.bat | 2 +- benchmarks/run_all.sh | 4 ++++ benchmarks/run_clang.sh | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 benchmarks/run_all.sh diff --git a/benchmarks/plot.py b/benchmarks/plot.py index bd386312..ea3871f4 100644 --- a/benchmarks/plot.py +++ b/benchmarks/plot.py @@ -1,13 +1,16 @@ +import sys import seaborn as sns import pandas as pd import matplotlib.pyplot as plt #sns.set_theme(style="whitegrid") comp = ['All compilers', 'Mingw-g++-10.30', 'Win-Clang-12', 'VC-19.28'] -n = 3 -df = pd.read_csv('plot_perf.csv') +n = int(sys.argv[1]) if len(sys.argv) > 1 else 0 +file = sys.argv[2] if len(sys.argv) > 2 else 'plot_win.csv' +df = pd.read_csv(file) df = df[df.Method != 'total'] -if n > 0: df = df[df.Compiler == comp[n]] +if n > 0: + df = df[df.Compiler == comp[n]] g = sns.catplot(data=df, x='Method', y='Seconds', hue='Library', col='C', kind='bar', ci=68, legend=False, col_wrap=2, sharex=False, aspect=1.4, height=3.1) diff --git a/benchmarks/run_all.bat b/benchmarks/run_all.bat index 8f250871..2edd0a1e 100644 --- a/benchmarks/run_all.bat +++ b/benchmarks/run_all.bat @@ -1,4 +1,4 @@ -set out=plot_perf.csv +set out=plot_win.csv echo Compiler,Library,C,Method,Seconds,Ratio> %out% sh run_gcc.sh >> %out% sh run_clang.sh >> %out% diff --git a/benchmarks/run_all.sh b/benchmarks/run_all.sh new file mode 100644 index 00000000..f15a5881 --- /dev/null +++ b/benchmarks/run_all.sh @@ -0,0 +1,4 @@ +out="plot_linux.csv" +echo "Compiler,Library,C,Method,Seconds,Ratio"> $out +sh run_gcc.sh >> $out +sh run_clang.sh >> $out diff --git a/benchmarks/run_clang.sh b/benchmarks/run_clang.sh index f7575882..ae19486e 100644 --- a/benchmarks/run_clang.sh +++ b/benchmarks/run_clang.sh @@ -1,5 +1,5 @@ exe='' -if [ "$OS" == 'Windows_NT' ]; then exe='.exe'; fi +if [ "$OS" = "Windows_NT" ] ; then exe=".exe" ; fi clang++ -I../include -O3 -o cdeq_benchmark$exe cdeq_benchmark.cpp clang++ -I../include -O3 -o clist_benchmark$exe clist_benchmark.cpp clang++ -I../include -O3 -o cmap_benchmark$exe cmap_benchmark.cpp -- cgit v1.2.3