Skip to content

Traffic Counters Structures performance evaluation

Pavel Odintsov edited this page Jul 26, 2015 · 5 revisions

Non optimized compilation:

g++ traffic_structures_performance_tests.cpp -std=c++11 -lboost_system  -lboost_thread -ltbb -I/opt/local/include -L/opt/local/lib
Element size: 208
std::map: 0.8 mega ops per second
tbb::concurrent_unordered_map: 0.8 mega ops per second
boost::unordered_map: 1.0 mega ops per second
boost::container::flat_map with preallocated elements: 1.0 mega ops per second
std::unordered_map C++11: 2.0 mega ops per second
std::unordered_map C++11 preallocated buckets: 2.8 mega ops per second
google:dense_hashmap preallocated buckets: 5.4 mega ops per second
std::vector preallocated: 13.1 mega ops per second

Optimized compilation:

g++ -O3 traffic_structures_performance_tests.cpp -std=c++11 -lboost_system  -lboost_thread -ltbb -I/opt/local/include -L/opt/local/lib
Element size: 208
std::map: 1.9 mega ops per second
tbb::concurrent_unordered_map: 1.7 mega ops per second
boost::unordered_map: 1.7 mega ops per second
boost::container::flat_map with preallocated elements: 3.6 mega ops per second
std::unordered_map C++11: 4.5 mega ops per second
std::unordered_map C++11 preallocated buckets: 8.3 mega ops per second
google:dense_hashmap preallocated buckets: 18.7 mega ops per second
std::vector preallocated: 18.8 mega ops per second

Optimized compilation with clang from Git:

/usr/src/polly/llvm_build/bin/clang++ -O3 traffic_structures_performance_tests.cpp -std=c++11 -lboost_system  -lboost_thread -ltbb -I/opt/local/include -L/opt/local/lib
Element size: 208
std::map: 1.9 mega ops per second
tbb::concurrent_unordered_map: 1.7 mega ops per second
boost::unordered_map: 1.7 mega ops per second
boost::container::flat_map with preallocated elements: 1.3 mega ops per second
std::unordered_map C++11: 4.6 mega ops per second
std::unordered_map C++11 preallocated buckets: 8.3 mega ops per second
google:dense_hashmap preallocated buckets: 18.1 mega ops per second
std::vector preallocated: 23.2 mega ops per second

LLVM Polly optimized compilation from Git:

alias pollycc="/usr/src/polly/llvm_build/bin/clang -Xclang -load -Xclang /usr/src/polly/llvm_build/lib/LLVMPolly.so"
pollycc -O3 -mllvm -polly  traffic_structures_performance_tests.cpp -std=c++11 -lboost_system  -lboost_thread -ltbb -I/opt/local/include -L/opt/local/lib -lstdc++ -lm
Element size: 208
std::map: 1.9 mega ops per second
tbb::concurrent_unordered_map: 1.8 mega ops per second
boost::unordered_map: 1.7 mega ops per second
boost::container::flat_map with preallocated elements: 1.3 mega ops per second
std::unordered_map C++11: 4.7 mega ops per second
std::unordered_map C++11 preallocated buckets: 8.7 mega ops per second
google:dense_hashmap preallocated buckets: 19.7 mega ops per second
std::vector preallocated: 18.8 mega ops per second

LLVM Polly optimized compilation from Git with vectorization code:

alias pollycc="/usr/src/polly/llvm_build/bin/clang -Xclang -load -Xclang /usr/src/polly/llvm_build/lib/LLVMPolly.so"
pollycc -O3 -mllvm -polly -mllvm -polly-vectorizer=stripmine traffic_structures_performance_tests.cpp -std=c++11 -lboost_system  -lboost_thread -ltbb -I/opt/local/include -L/opt/local/lib -lstdc++ -lm
Element size: 208
std::map: 1.9 mega ops per second
tbb::concurrent_unordered_map: 1.8 mega ops per second
qqqboost::unordered_map: 1.7 mega ops per second
boost::container::flat_map with preallocated elements: 1.3 mega ops per second
std::unordered_map C++11: 4.7 mega ops per second
std::unordered_map C++11 preallocated buckets: 8.7 mega ops per second
google:dense_hashmap preallocated buckets: 17.7 mega ops per second
std::vector preallocated: 18.9 mega ops per second
Clone this wiki locally