• Stars
    star
    178
  • Rank 214,989 (Top 5 %)
  • Language
    C++
  • License
    Apache License 2.0
  • Created over 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Modern C++ B-tree containers

C++ B-tree

Code in this repository is based on Google's B-tree implementation.

C++ B-tree is a template library that implements ordered in-memory containers based on a B-tree data structure. Similar to the STL std::map, std::set, std::multimap, and std::multiset templates, this library provides btree::map, btree::set, btree::multimap and btree::multiset.

This difers from the original project by Google in that containers behave more like modern STL (C++17) and are an almost drop-in replacements (except for the iterator invalidation, see below); including support for emplace and try_emplace as well as values in the map not needing to have a default constructor.

C++ B-tree containers have a few advantages compared with the standard containers, which are typically implemented using Red-Black trees. Nodes in a Red-Black tree require three pointers per entry (plus 1 bit), whereas B-trees on average make use of fewer than one pointer per entry, leading to significant memory savings. For example, a set<int32_t> has an overhead of 16 bytes for every 4 byte set element (on a 32-bit operating system); the corresponding btree::set<int32_t> has an overhead of around 1 byte per set element.

B-trees are widely known as data structures for secondary storage, because they keep disk seeks to a minimum. For an in-memory data structure, the same property yields a performance boost by keeping cache-line misses to a minimum. C++ B-tree containers make better use of the cache by performing multiple key-comparisons per node when searching the tree. Although B-tree algorithms are more complex, compared with the Red-Black tree algorithms, the improvement in cache behavior may account for a significant speedup in accessing large containers.

The C++ B-tree containers are not without drawbacks, however. Unlike the standard STL containers, modifying a C++ B-tree container invalidates all outstanding iterators on that container.

More Repositories

1

pyScss

pyScss, a Scss compiler for Python
CSS
582
star
2

Xapiand

Xapiand: A RESTful Search Engine
C++
363
star
3

esprima-python

ECMAScript parsing infrastructure for multipurpose analysis
Python
206
star
4

KomodoEdit-SublimeCodeIntel

Python
119
star
5

ColorHighlight

🎨 Lightweight Color Highlight colorizer for Sublime Text
Python
109
star
6

SublimeLinter

40
star
7

constexpr-phf

Computes a constexpr (minimal) perfect hash function
C++
32
star
8

TextMarker

πŸ– Text Marker (Highlighter) highlights words in Sublime Text
Python
20
star
9

Kronuz-Theme

Kronuz Theme for Sublime Text 3
16
star
10

SublimeCodeIntel

πŸ’‘ SublimeCodeIntel LSP
Python
14
star
11

ansi2html

Simple Python tool to convert ANSI color characters to HTML with colored style.
Python
14
star
12

base-x

BaseX encoder / decoder for C++
C++
12
star
13

IndentSize

Sublime Text 3 plugin for adding indent_size setting
Python
8
star
14

pyXapiand

Xapian indexing and querying server implemented in Python
Python
5
star
15

iscroll-overflow

Similar to iScroll4 (lite), using native overflow
JavaScript
3
star
16

django-gitlist

Django GitList
JavaScript
2
star
17

logkext

logKext is a freeware open-source keylogger for OS X that hooks into the kernel to bypass userspace security measures.
C++
2
star
18

react-gestalt-masonry

Masonry ported to TypeScript from pinterest/gestalt
TypeScript
1
star
19

leetcode

C++
1
star
20

OpenLegends

C++
1
star
21

console-colorizer

Adds colored console logging (for node and browser)
TypeScript
1
star
22

HTML-CodeIntel

HTML Plugin for SublimeCodeIntel LSP
JavaScript
1
star
23

KomodoEdit-CodeIntel

C
1
star
24

fsc

FreeBSD Services Control Utilities
C
1
star
25

docker-nginx

Alpine Docker image with Nginx 1.14.0 + LUA + Push Stream +H264 streaming + Headers More
Dockerfile
1
star
26

SublimeStackTracer

What are my Sublime Text plugins doing?
Python
1
star
27

react-gestalt-collage

Collage ported to TypeScript from pinterest/gestalt
TypeScript
1
star