r/cpp • • Aug 02 '26

How fast is C++26's std::hive?

https://lemire.me/blog/2026/08/02/how-fast-is-c26s-stdhive/
255 Upvotes

74 comments sorted by

View all comments

Show parent comment

1

u/TheRealSmolt Aug 02 '26 edited Aug 03 '26

How so?

Edit: If you're asking about random access, it's because as u/eteran mentioned, it's an array of arrays instead of a list of arrays. I didn't think the distinction was particularly important.

1

u/frayien Aug 03 '26

I thought the requirements on pointer invalidation on insertion where stricter, but it seems they only apply to front and back insertion. And yeah it seems they are implemented with small blocks by libc++ and libstdc++.

Main difference with hive I think is the absence of guaranties on element order. Which allows bigger blocks without compromising performance.