Home

PLF Library - plf::hive vs boost::hub benchmarks - clang

Last updated 23-5-2026

  1. Test setup
  2. Insert-erase-iterate
  3. General use - Unordered low-modification scenario
  4. General use - Unordered high-modification scenario
  5. Referencing scenario
  6. Sort
  7. Overall performance conclusions

Test machine setup

Running clang-cl 19 (under MSVC 2026 x64) as compiler. Relevant build settings are standard unaltered release settings: "/GS /W3 /Gy /Zi /O2 /fp:precise /D "NDEBUG" /WX- /Gd /Oi /MD /std:c++20 /EHsc".

Full spreadsheet data is here.

For more general details and benchmark code see main page.

Insert-erase-iterate

Insertion Performance

Click images or hover over to see results at linear scale instead

test result graph
test result graph
test result graph

Erase Performance

Click images or hover over to see results at linear scale instead

test result graph
test result graph
test result graph

Post-erasure Iteration Performance

Click images or hover over to see results at linear scale instead

test result graph
test result graph
test result graph

To summarize, for double on average hive is 40% slower for insert, 18% slower for erase and 5% slower for iteration.
For small structs it's 55% slower, 26% slower and 1% faster.
For large structs it's 42% faster, 18% slower and 28% faster.

Real-world scenario testing - unordered low modification

Datatype is small struct (48 bytes), frame = one iteration pass over all elements in container.

Click images or hover over to see results at linear scale instead

Performance results

test result graph
test result graph
test result graph

plf::hive is 8% faster than hub on average.

Real-world scenario testing - unordered high modification

Same as the previous test but here we erase/insert 1% of all elements per-frame instead of per 3600 frames, then once again increase the percentage to 5% then 10% per-frame. This simulates the use-case of continuously-changing data, for example video game bullets, decals, quadtree/octree nodes, cellular/atomic simulation or weather simulation.

Performance results

Click images or hover over to see results at linear scale instead

test result graph
test result graph
test result graph

plf::hive is 20% slower than hub on average for the 1% scenario, 22% slower for the 5% scenario, and 26% slower for the 10% scenario.

Real-world scenario-testing: referencing with interlinked containers

This test utilizes four instances of the same container type, each containing different element types:

  1. A 'collisions' container (which could represent collision rectangles within a quadtree/octree/grid/etc)
  2. An 'entities' container (which could representing general game objects) and
  3. Two subcomponent containers (these could be sprites, sounds, or anything else).
test class diagram

For full explanation see the main colony benchmarks page.

Performance results

Click images or hover over to see results at linear scale instead

test result graph
test result graph
test result graph
test result graph
test result graph
test result graph

Average speed increase of hive over hub is between 22% and 408%, depending on insert/erase-to-iterate ratio, but with a massive skew in the larger numbers of elements. Up to 29x faster at highest ratio and number of elements.

Sort performance

test result graph
test result graph test result graph
test result graph
test result graph

clang overall Performance Conclusions

Hub is generally faster except for large types and lower ratios of insert/erase-to-iteration. Where get_iterator is involved hub is much slower.

Contact: footer
plf:: library and this page Copyright (c) 2026, Matthew Bentley.