Skip to content

sukeya/platanus

Repository files navigation

platanus

platanus logo

platanus is a modern fork of the B-tree library cpp-btree.

Why?

To make cpp-btree more accessible for use in modern C++ projects.

Changes Made from the Original Implementation

  • Support for C++20
  • Available as a CMake package
  • Support for std::pmr
  • Three-way comparison implementation
  • Improved testing and CI setup
  • Enhanced readability and maintainability
  • Benchmarking against STL and Abseil

Smallest use example

#include <platanus/btree_map.hpp>

int main()
{
    platanus::btree_map<int, int> values;
    values.emplace(1, 100);
    values.emplace(2, 200);
}

Benchmark result

In certain scenarios, it demonstrates superior search and insertion performance compared to std::map. Other cases may favor Abseil's B-tree implementation.

Documentation

See here.

For local preview and static builds of the documentation site:

zensical serve
zensical build

Benchmark

You can build the benchmark with:

cmake -S . -B build/release -DPLATANUS_BUILD_BENCHMARK=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build/release --target btree_bench

When PLATANUS_BENCHMARK_WITH_ABSL=ON (default), the benchmark runs in comparison mode and registers:

  • STL
  • absl
  • platanus(64)

In that mode, platanus(128) and platanus::pmr benchmark variants are intentionally excluded. See the documentation site for more benchmark details and plotting scripts.

License

platanus is licensed under Apache License, Version 2.0.

About

A modern fork of cpp-btree.

Topics

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Contributors