Skip to content

Traffic Counters Structures performance evaluation

Pavel Odintsov edited this page Jun 20, 2022 · 5 revisions

Just build FastNetMon Community that way:

cmake .. -DENABLE_CUSTOM_BOOST_BUILD=FALSE -DDO_NOT_USE_SYSTEM_LIBRARIES_FOR_BUILD=FALSE -DBUILD_TESTS=ON
make -j

And then run test suite:

./traffic_structures_tests

Test machine:

AMD Ryzen 7 5800X 8-Core Processor, 32G RAM

Platform:

Ubuntu 22.04, Boost 1.74, gcc 11.2.0

Results:

Element size: 216 bytes
Total structure size: 2059 Mbytes
std::map: 6.5 mega ops per second
std::map precreated: 11.1 mega ops per second
boost::unordered_map: 12.0 mega ops per second
boost::unordered_map with preallocated elements: 40.1 mega ops per second
boost::unordered_map with precreated elements: 98.2 mega ops per second
boost::container::flat_map with preallocated elements: 8.3 mega ops per second
std::unordered_map C++11: 17.9 mega ops per second
std::unordered_map C++11 preallocated buckets: 24.0 mega ops per second
std::unordered_map C++11 precreated elements: 87.1 mega ops per second
std::vector preallocated: 160.1 mega ops per second
C array preallocated: 157.7 mega ops per second
Clone this wiki locally