Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pavel-odintsov/31f2b393f45d10445283dfd6459a35e3 to your computer and use it in GitHub Desktop.
Save pavel-odintsov/31f2b393f45d10445283dfd6459a35e3 to your computer and use it in GitHub Desktop.
Absl vs Boost 1.80 vs std::unordered_map
Loaded 183978 IPs into memory
AMD Ryzen 5 3600 6-Core Processor
std::map big endian
Total lookup time is 58 seconds
Million of lookup ops per second: 3.12534
Total scan time is 16 seconds
Million of full scan ops per second: 8.33437
Accumulator value to guarantee no optimisation tricks from compiler: 183978000000
std::map little endian
Total lookup time is 59 seconds
Million of lookup ops per second: 3.14655
Total scan time is 15 seconds
Million of full scan ops per second: 8.34393
Accumulator value to guarantee no optimisation tricks from compiler: 183978000000
std::unordered_map big endian
Total lookup time is 8 seconds
Million of lookup ops per second: 24.4749
Total scan time is 10 seconds
Million of full scan ops per second: 12.2954
Bucket number: 172933
Accumulator value to guarantee no optimisation tricks from compiler: 183978000000
std::unordered_map little endian
Total lookup time is 8 seconds
Million of lookup ops per second: 25.2212
Total scan time is 10 seconds
Million of full scan ops per second: 12.2536
Bucket number: 172933
Accumulator value to guarantee no optimisation tricks from compiler: 183978000000
boost::unordered_map big endian
Total lookup time is 6 seconds
Million of lookup ops per second: 32.9995
Total scan time is 4 seconds
Million of full scan ops per second: 34.967
Bucket number: 196613
Accumulator value to guarantee no optimisation tricks from compiler: 183978000000
boost::unordered_map little endian
Total lookup time is 5 seconds
Million of lookup ops per second: 33.7007
Total scan time is 4 seconds
Million of full scan ops per second: 35.2546
Bucket number: 196613
Accumulator value to guarantee no optimisation tricks from compiler: 183978000000
absl::flat_hash_map little endian
Total lookup time is 5 seconds
Million of lookup ops per second: 33.9046
Total scan time is 2 seconds
Million of full scan ops per second: 102.692
Bucket number: 0
Accumulator value to guarantee no optimisation tricks from compiler: 183978000000
absl::flat_hash_map big endian
Total lookup time is 5 seconds
Million of lookup ops per second: 34.0047
Total scan time is 1 seconds
Million of full scan ops per second: 98.0388
Bucket number: 0
Accumulator value to guarantee no optimisation tricks from compiler: 183978000000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment