Coder Social home page Coder Social logo

cpp-btree's Introduction

C++ B-tree is a template library that implements ordered in-memory containers based on a B-tree data structure. Based on https://code.google.com/archive/p/cpp-btree/, but forked from https://github.com/algorithm-ninja/cpp-btree.

A B-tree based implementation can have advantages over the RB-tree based implementations of std::map. It has fewer pointers leading to significant memory savings and less memory fragmentation. Due to better usage of cache lines, large containers can also see a significant performance increase. See btree_bench.cc for details.

The disadvantage is that all modifications invalidate all pointers and iterators due to possible merge/split operations.

The dmeister repo adds C++11 integration, e.g. rvalue constructor and assignment, emplace() and at().


This library is a C++ template library and, as such, there is no library to build and install. Copy the .h files and use them!

See UsageInstructions for details.


To build and run the provided tests, however, you will need to install CMake, the Google C++ Test framework, and the Google flags package.

export GTEST_ROOT=/path/for/gtest-x.y
export GFLAGS_ROOT=/opt

cmake . -Dbuild_tests=ON

For example, to build on a Unix system with the clang++ compiler,

export GTEST_ROOT=$(HOME)/src/googletest
export GFLAGS_ROOT=/opt
cmake . -G "Unix Makefiles" -Dbuild_tests=ON -DCMAKE_CXX_COMPILER=clang++

For example to build with ninja and clang++:

mkdir build
pushd build
cmake .. -GNinja -Dbuild_tests=ON
popd build
ninja -C build
ninja install

cpp-btree's People

Contributors

gerhobbelt avatar googlecodeexporter avatar jmacd avatar mrks avatar sakamura avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

turol loulinghui

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.