Home

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

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 MSVC 2026 x64 as compiler (build 14.51). 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 6% slower for insert, 14% slower for erase and 3% faster for iteration.
For small structs it's 40% slower, 29% slower and 2% slower.
For large structs it's 93% faster, 22% slower and 32% 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 6% 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 14% faster than hub on average for the 1% scenario, 4% faster for the 5% scenario, and 6% 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 5% and 344%, depending on insert/erase-to-iterate ratio, but with a massive skew in the larger numbers of elements. Up to 25x 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

MSVC overall Performance Conclusions

Hive is generally faster except for small types and high ratios of insert/erase-to-iteration. Microbenchmarks of small structs show a slightly different outlook to the 'real world' unordered modification tests, because the microbenchmarks don't show how erasure and insertion affect iteration performance over time. Where get_iterator is involved hub is much slower.

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