From 9907f43d30487efe5e7cb42c9a5e5a000ca44938 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Wed, 2 Jun 2021 23:03:25 +0200 Subject: Updated benchmarks. --- README.md | 4 ++-- benchmarks/pics/benchmark.gif | Bin 0 -> 160087 bytes benchmarks/pics/benchmark.png | Bin 56364 -> 0 bytes benchmarks/plot.py | 7 +++++-- benchmarks/run_all.bat | 1 - benchmarks/run_clang.sh | 21 +++++++++++---------- benchmarks/run_gcc.sh | 21 +++++++++++---------- benchmarks/run_vc.bat | 21 +++++++++++---------- 8 files changed, 40 insertions(+), 35 deletions(-) create mode 100644 benchmarks/pics/benchmark.gif delete mode 100644 benchmarks/pics/benchmark.png diff --git a/README.md b/README.md index 693cee96..a77cdf96 100644 --- a/README.md +++ b/README.md @@ -46,9 +46,9 @@ Highlights Performance ----------- -![Benchmark](benchmarks/pics/benchmark.png) +![Benchmark](benchmarks/pics/benchmark.gif) Benchmark notes: -- The barchart shows average test times over three platforms: Win-Clang++ v11, Mingw64 g++ 9.20, VC19. CPU: Ryzen 7 2700X CPU @4Ghz. +- The barchart shows average test times over three platforms: Mingw64 10.30, Win-Clang 12, VC19. CPU: Ryzen 7 2700X CPU @4Ghz. - Containers uses value types `uint64_t` and pairs of `uint64_t`for the maps. - Black bars indicates performance variation between various platforms/compilers. - Iterations are repeated 4 times over n elements. diff --git a/benchmarks/pics/benchmark.gif b/benchmarks/pics/benchmark.gif new file mode 100644 index 00000000..90f47fff Binary files /dev/null and b/benchmarks/pics/benchmark.gif differ diff --git a/benchmarks/pics/benchmark.png b/benchmarks/pics/benchmark.png deleted file mode 100644 index 1c9b18d7..00000000 Binary files a/benchmarks/pics/benchmark.png and /dev/null differ diff --git a/benchmarks/plot.py b/benchmarks/plot.py index 13962b52..bd386312 100644 --- a/benchmarks/plot.py +++ b/benchmarks/plot.py @@ -3,16 +3,19 @@ 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') df = df[df.Method != 'total'] +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.6, height=3) + ci=68, legend=False, col_wrap=2, sharex=False, aspect=1.4, height=3.1) g.set_xlabels('') g.add_legend(bbox_to_anchor=(0.75, 0.2), borderaxespad=0.) g.fig.subplots_adjust(top=0.90, left=0.06, bottom=0.07) -g.fig.suptitle('Benchmark STC vs c++ std containers', fontsize=15, y=0.98) +g.fig.suptitle('Benchmark STC vs c++ std containers: %s' % comp[n], fontsize=15, y=0.98) plt.show() diff --git a/benchmarks/run_all.bat b/benchmarks/run_all.bat index 25f7af83..8f250871 100644 --- a/benchmarks/run_all.bat +++ b/benchmarks/run_all.bat @@ -2,5 +2,4 @@ set out=plot_perf.csv echo Compiler,Library,C,Method,Seconds,Ratio> %out% sh run_gcc.sh >> %out% sh run_clang.sh >> %out% -rem make sure cl.exe environment is available. call run_vc.bat >> %out% diff --git a/benchmarks/run_clang.sh b/benchmarks/run_clang.sh index 71a8981d..e8e9910f 100644 --- a/benchmarks/run_clang.sh +++ b/benchmarks/run_clang.sh @@ -1,11 +1,12 @@ -clang++ -I.. -O3 -o cdeq_benchmark.exe cdeq_benchmark.cpp -clang++ -I.. -O3 -o clist_benchmark.exe clist_benchmark.cpp -clang++ -I.. -O3 -o cmap_benchmark.exe cmap_benchmark.cpp -clang++ -I.. -O3 -o csmap_benchmark.exe csmap_benchmark.cpp -clang++ -I.. -O3 -o cvec_benchmark.exe cvec_benchmark.cpp +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 +clang++ -I../include -O3 -o csmap_benchmark.exe csmap_benchmark.cpp +clang++ -I../include -O3 -o cvec_benchmark.exe cvec_benchmark.cpp -./cdeq_benchmark.exe Win-Clang-11 -./clist_benchmark.exe Win-Clang-11 -./cmap_benchmark.exe Win-Clang-11 -./csmap_benchmark.exe Win-Clang-11 -./cvec_benchmark.exe Win-Clang-11 +c=Win-Clang-12 +./cdeq_benchmark.exe $c +./clist_benchmark.exe $c +./cmap_benchmark.exe $c +./csmap_benchmark.exe $c +./cvec_benchmark.exe $c diff --git a/benchmarks/run_gcc.sh b/benchmarks/run_gcc.sh index 5c25b662..460afe16 100644 --- a/benchmarks/run_gcc.sh +++ b/benchmarks/run_gcc.sh @@ -1,11 +1,12 @@ -g++ -I.. -O3 -o cdeq_benchmark.exe cdeq_benchmark.cpp -g++ -I.. -O3 -o clist_benchmark.exe clist_benchmark.cpp -g++ -I.. -O3 -o cmap_benchmark.exe cmap_benchmark.cpp -g++ -I.. -O3 -o csmap_benchmark.exe csmap_benchmark.cpp -g++ -I.. -O3 -o cvec_benchmark.exe cvec_benchmark.cpp +g++ -I../include -O3 -o cdeq_benchmark.exe cdeq_benchmark.cpp +g++ -I../include -O3 -o clist_benchmark.exe clist_benchmark.cpp +g++ -I../include -O3 -o cmap_benchmark.exe cmap_benchmark.cpp +g++ -I../include -O3 -o csmap_benchmark.exe csmap_benchmark.cpp +g++ -I../include -O3 -o cvec_benchmark.exe cvec_benchmark.cpp -./cdeq_benchmark.exe Mingw-g++-9.20 -./clist_benchmark.exe Mingw-g++-9.20 -./cmap_benchmark.exe Mingw-g++-9.20 -./csmap_benchmark.exe Mingw-g++-9.20 -./cvec_benchmark.exe Mingw-g++-9.20 \ No newline at end of file +c=Mingw-g++-10.30 +./cdeq_benchmark.exe $c +./clist_benchmark.exe $c +./cmap_benchmark.exe $c +./csmap_benchmark.exe $c +./cvec_benchmark.exe $c \ No newline at end of file diff --git a/benchmarks/run_vc.bat b/benchmarks/run_vc.bat index aee00cd7..3dca925b 100644 --- a/benchmarks/run_vc.bat +++ b/benchmarks/run_vc.bat @@ -1,14 +1,15 @@ @echo off if "%VSINSTALLDIR%"=="" call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" >nul -cl.exe -nologo -EHsc -std:c++latest -I.. -O2 cdeq_benchmark.cpp >nul -cl.exe -nologo -EHsc -std:c++latest -I.. -O2 clist_benchmark.cpp >nul -cl.exe -nologo -EHsc -std:c++latest -I.. -O2 cmap_benchmark.cpp >nul -cl.exe -nologo -EHsc -std:c++latest -I.. -O2 csmap_benchmark.cpp >nul -cl.exe -nologo -EHsc -std:c++latest -I.. -O2 cvec_benchmark.cpp >nul +cl.exe -nologo -EHsc -std:c++latest -I../include -O2 cdeq_benchmark.cpp >nul +cl.exe -nologo -EHsc -std:c++latest -I../include -O2 clist_benchmark.cpp >nul +cl.exe -nologo -EHsc -std:c++latest -I../include -O2 cmap_benchmark.cpp >nul +cl.exe -nologo -EHsc -std:c++latest -I../include -O2 csmap_benchmark.cpp >nul +cl.exe -nologo -EHsc -std:c++latest -I../include -O2 cvec_benchmark.cpp >nul del *.obj >nul -cdeq_benchmark.exe VC-19.28 -clist_benchmark.exe VC-19.28 -cmap_benchmark.exe VC-19.28 -csmap_benchmark.exe VC-19.28 -cvec_benchmark.exe VC-19.28 \ No newline at end of file +set c=VC-19.28 +cdeq_benchmark.exe %c% +clist_benchmark.exe %c% +cmap_benchmark.exe %c% +csmap_benchmark.exe %c% +cvec_benchmark.exe %c% \ No newline at end of file -- cgit v1.2.3