Skip to content

Commit

Permalink
feat: A fully featured btree implementation (#3126)
Browse files Browse the repository at this point in the history
This is a fully featured btree implementation. A friend gave me some
incomplete (and broken) btree code for Go, and when I started reworking
it, I discovered that it was a broken semi-copy of an old version of
Google's btree for Go.

I finished reworking it so that it adhere's to that original Google
version's API, though there are some differences internally in places,
and I think that my version is much easier to follow and to understand.

This implementation is quite a bit faster than the AVL tree. I will add
links to some benchmarks that I did in a comment. This implementation
supports copy-on-write for the trees, for inexpensively creating copies
of a tree that are effectively isolated from each other with respect to
changes that happen after the fork.

<details><summary>Contributors' checklist...</summary>

- [x] Added new tests, or not needed, or not feasible
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [ ] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
</details>
  • Loading branch information
wyhaines authored Dec 5, 2024
1 parent b631207 commit 7ce29ff
Show file tree
Hide file tree
Showing 3 changed files with 1,793 additions and 0 deletions.
Loading

0 comments on commit 7ce29ff

Please sign in to comment.