{"id":15630709,"url":"https://github.com/kronuz/cpp-btree","last_synced_at":"2025-07-09T17:08:42.067Z","repository":{"id":39979351,"uuid":"200279486","full_name":"Kronuz/cpp-btree","owner":"Kronuz","description":"Modern C++ B-tree containers","archived":false,"fork":false,"pushed_at":"2023-08-11T19:54:03.000Z","size":35,"stargazers_count":272,"open_issues_count":1,"forks_count":53,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-19T18:09:19.889Z","etag":null,"topics":["btree","c-plus-plus","map","modern-cpp","multimap","multiset","set"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kronuz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-02T18:19:08.000Z","updated_at":"2025-05-17T01:33:22.000Z","dependencies_parsed_at":"2024-10-23T01:33:21.508Z","dependency_job_id":null,"html_url":"https://github.com/Kronuz/cpp-btree","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Kronuz/cpp-btree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kronuz%2Fcpp-btree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kronuz%2Fcpp-btree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kronuz%2Fcpp-btree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kronuz%2Fcpp-btree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kronuz","download_url":"https://codeload.github.com/Kronuz/cpp-btree/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kronuz%2Fcpp-btree/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264502167,"owners_count":23618557,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["btree","c-plus-plus","map","modern-cpp","multimap","multiset","set"],"created_at":"2024-10-03T10:35:34.974Z","updated_at":"2025-07-09T17:08:41.993Z","avatar_url":"https://github.com/Kronuz.png","language":"C++","readme":"# C++ B-tree\n\nCode in this repository is based on\n[Google's B-tree implementation](https://code.google.com/archive/p/cpp-btree/).\n\nC++ B-tree is a template library that implements ordered in-memory containers\nbased on a B-tree data structure. Similar to the STL `std::map`, `std::set`,\n`std::multimap`, and `std::multiset` templates, this library provides\n`btree::map`, `btree::set`, `btree::multimap` and `btree::multiset`.\n\nThis difers from the original project by Google in that containers behave more\nlike modern STL (C++17) and are an almost drop-in replacements (except for the\niterator invalidation, see below); including support for `emplace` and\n`try_emplace` as well as values in the map not needing to have a default\nconstructor.\n\nC++ B-tree containers have a few advantages compared with the standard\ncontainers, which are typically implemented using Red-Black trees. Nodes in a\nRed-Black tree require three pointers per entry (plus 1 bit), whereas B-trees\non average make use of fewer than one pointer per entry, leading to\n**significant memory savings**. For example, a `set\u003cint32_t\u003e` has an overhead\nof 16 bytes for every 4 byte set element (on a 32-bit operating system); the\ncorresponding `btree::set\u003cint32_t\u003e` has an overhead of around 1 byte per set\nelement.\n\nB-trees are widely known as data structures for secondary storage, because they\nkeep disk seeks to a minimum. For an in-memory data structure, the same property\nyields a performance boost by keeping cache-line misses to a minimum. C++ B-tree\ncontainers make better use of the cache by performing multiple key-comparisons\nper node when searching the tree. Although B-tree algorithms are more complex,\ncompared with the Red-Black tree algorithms, the improvement in cache behavior\nmay account for a **significant speedup** in accessing large containers.\n\nThe C++ B-tree containers are not without drawbacks, however. Unlike the\nstandard STL containers, modifying a C++ B-tree container\n**invalidates all outstanding iterators** on that container.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkronuz%2Fcpp-btree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkronuz%2Fcpp-btree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkronuz%2Fcpp-btree/lists"}