Google Abseil Btree
Sergey AbbakumovIn the Google Abseil C++ library https://github.com/abseil/abseil-cpp/tree/master/absl/container that I already wrote about (https://t.me/sea_plus_plus/69), four new STL-like Btree containers were added: absl::btree_map
, absl::btree_multimap
, absl::btree_set
and absl::btree_multiset
. The data is stored in memory, but under the hood, there is the algorithm that came from the databases. Btree stores several elements in one memory block, which reduces the number of allocations, and also, due to more efficient use of the cache, works faster in most cases.
This is practically a drop-in replacement for std::map
and std::set
. However, when inserting and deleting, iterators are invalidated. Therefore, one must be careful.
Telegram channel: https://t.me/sea_plus_plus