C++ container performance
Dennis Glatting
freebsd at pki2.com
Fri Jul 24 22:53:53 UTC 2015
I have a relatively small program (needs to be smaller for post) where
the performance of some STD c++ containers (deque and queue) is more or
less twice as slow under clang than gcc. My question is whether I should
file something under FreeBSD or llvm? Or maybe this is a known,
irrelevant problem?
Summary:
clang++ 3.4.1 clang++ 3.7.0 g++49 g++5
deque: 0.000890143 0.000646584 0.000367548 0.000365817
root at Tasha# uname -a
FreeBSD Tasha 10.2-BETA1 FreeBSD 10.2-BETA1 #0 r285434: Sun Jul 12
16:57:18 PDT 2015
root at Tasha:/disk-2/obj/disk-1/src/sys/SMUNI-FreeBSD10-amd64 amd64
root at Tasha# c++ -O3 -std=c++11 -Wsign-compare -Wall -Wno-uninitialized
-fvisibility=hidden -finline -I /usr/local/include main_dc.cc
complex deque: size=88
Done: total_t: 44507162167, sec_t: 44.5072, t/ea: 0.000890143
root at Tasha# clang++-devel -O3 -std=c++11 -Wsign-compare -Wall
-Wno-uninitialized -fvisibility=hidden -finline -I /usr/local/include
main_dc.cc
complex deque: size=88
Done: total_t: 32329207134, sec_t: 32.3292, t/ea: 0.000646584
root at Tasha# g++49 -O3 -std=c++11 -Wsign-compare -Wall -Wno-uninitialized
-fvisibility=hidden -finline -I /usr/local/include main_dc.cc
complex deque: size=120
Done: total_t: 18377396318, sec_t: 18.3774, t/ea: 0.000367548
root at Tasha# g++5 -O3 -std=c++11 -Wsign-compare -Wall -Wno-uninitialized
-fvisibility=hidden -finline -I /usr/local/include main_dc.cc
complex deque: size=120
Done: total_t: 18290835564, sec_t: 18.2908, t/ea: 0.000365817
root at Tasha# g++6 -O3 -std=c++11 -Wsign-compare -Wall -Wno-uninitialized
-fvisibility=hidden -finline -I /usr/local/include main_dc.cc
complex deque: size=120
Done: total_t: 18249643758, sec_t: 18.2496, t/ea: 0.000364993
More information about the freebsd-questions
mailing list