PackageTrack
Sign in Get early access

github.com/tidwall/btree

v1.8.1 #1481 most downloaded on Go modules tidwall/btree

What this package is like to depend on

Last release 3 months ago

17 May 2026

Release timing varies

gaps range from 8 days to 13 months

Rarely documented

notes for 4 of 33 stable releases

Nothing withdrawn

no release was ever pulled

12 years old

97 releases · first in 2014

4 releases in the last 12 months

see the full history below

Release timeline

97 releases · Aug 2014 to May 2026
2015 2017 2019 2021 2023 2025
Release Pre-release

Releases

latest 60 of 97
  1. v1.8.2-0.20260517004655-34be4b89c690 17 May 2026 pre-release

    Nothing published for this version

  2. v1.8.2-0.20260228094419-a72b8ecd33e4 28 Feb 2026 pre-release

    Nothing published for this version

  3. v1.8.2-0.20251103153907-da3712be86f9 03 Nov 2025 pre-release

    Nothing published for this version

  4. v1.8.2-0.20250806233643-9ce5205f5d8c 06 Aug 2025 pre-release

    Nothing published for this version

  5. v1.8.1 05 Aug 2025
    Release notes

    Merge pull request #50 from canibeanartisttoo/arjun/opt_alloc_delete_…

    Open source →
  6. v1.8.1-0.20250705014644-82b45e942cde 05 Jul 2025 pre-release

    Nothing published for this version

  7. v1.8.0 04 Jul 2025
    Release notes

    This commit adds the two new methods DeleteRange(min, max) and
    DeleteAscend(min, iter) for efficiently deleting a sub-range and performing an
    iteration-based delete on items.

    Prior to this commit the two options for deleting data were Delete(key) and
    DeleteHint(key, hint).

    These worked fine in most cases where a one-off deletion is all that's needed.

    But for batch or filter-like deletions, these are suboptimal because they
    require knowing the keys beforehand. Meaning the user will likely need to call
    something like the Ascend(min, iter) iterator to grab the keys and store them
    into temporary list before looping over the list to perform the actual deletes.

    The new DeleteAscend(min, iter) function, like the traditional Ascend(min, iter)
    function, accepts an iterator callback and ranges over the items starting at
    min. The user controls the iterator by returning an Action type. The callback
    is called for each item until it reaches the end of the tree or until the user
    returns Stop. If the user returns Delete, the item is deleted. The value Keep
    can be returns to keep the existing item and continue iterating.

    This implementation of DeleteAscend is optimized to avoid having to continually
    traverse the tree for each item. Rather, it works to keep the cursor at the
    leaf level as much as possible, moving up and down tree in a non-recursive loop.

    The new DeleteRange(min, max) function accepts a min (inclusive) and max
    (exclusive) sub-range. All items in the range are deleted and returned to the
    user. This operation is very fast because in many cases branch nodes can
    be completely removed without visiting their internal children. This allows for
    large spans of branch node removals to feel near instant. Since this B-tree
    library adopts the properties of a Counted B-tree, the number of items in the
    subtrees are know at the branch node level, allowing for easy maintenance
    of parent node counts.

    There's also an optional param for DeleteRange that, when provided, allows for
    ignoring returning the deleted items, further increasing performance.

    Benchmarks

    Some basic benchmarks are included in the btreeg_test.go file.

    Run 'go test -run TestContiguousDelete'

    It uses the Delete, DeleteHint, DeleteAscend, and DeleteRange strategies.
    Also included is a DeleteRange that does not return the deleted results.

    What each bench does is create a randomly sized B-tree, up to 200k items.

    Then it performs a batch delete of a random window size up to 50% the number
    of items in the tree. It then performs multiple runs until the total number of
    deleted items is greater than 200k. Each run builds a new tree. Only the
    delete operations are calculated in the duration.

    These are the results on a MacBook M1.

    Delete deleted 204,536 items in 0.0242 secs, 118 ns/item, 8,458,572/s
    DeleteHint deleted 204,605 items in 0.0184 secs, 90 ns/item, 11,145,431/s
    DeleteAscend deleted 200,598 items in 0.0120 secs, 60 ns/item, 16,771,705/s
    DeleteRange deleted 200,591 items in 0.0023 secs, 11 ns/item, 87,355,868/s
    DeleteRangeNoRet deleted 200,861 items in 0.0013 secs, 7 ns/item, 150,040,823/s

    Open source →
  8. v1.7.1-0.20240609154626-51838063d453 09 Jun 2024 pre-release

    Nothing published for this version

  9. v1.7.0 06 Sep 2023
    Release notes

    These new functions allow for using a path hint with iterators,
    making it potentially faster when seeking to the first item in the iteration.

    Benchmarks:

    https://github.com/tidwall/btree-benchmark

    About path hints:

    https://github.com/tidwall/btree/blob/master/PATH_HINT.md

    Usage:

    tr.AscendHint(key, iter, &hint)   // iterate items that are >= key, ascending
    tr.DescendHint(key, iter, &hint)  // iterate items that are <= key, descending
    iter.SeekHint(key, &hint)         // seek to item that is >= key
    Open source →
  10. v1.6.1-0.20230906214737-8d3586de4bce 06 Sep 2023 pre-release

    Nothing published for this version

  11. v1.6.1-0.20230330191724-6b2609133882 30 Mar 2023 pre-release

    Nothing published for this version

  12. v1.6.0 08 Dec 2022
    Release notes

    This commits includes new Mut methods which ensure that values get
    correctly copied, if needed, following a btree Copy() operations.

    This effictively allows for the BTree Copy method to create an isolated
    snapshot that cascades to the interior values. Such as a BTree that has
    nested BTrees as values.

    Mut methods are only useful when all of the following are true:

    • The interior data of the values require changes.
    • The value is a pointer type.
    • The BTree has been copied using Copy() or IsoCopy().
    • The value itself has a Copy() or IsoCopy() method.

    Mut methods may modify the tree structure and should have the same
    considerations as other mutable operations like Set, Delete, Clear, etc.

    New methods include GetMut, ScanMut, AscendMut, DescendMut, ReverseMut,
    IterMut, MinMut, MaxMut, etc.

    Open source →
  13. v1.5.3-0.20230904230706-ccc2c19c0e23 04 Sep 2023 pre-release

    Nothing published for this version

  14. v1.5.2 09 Nov 2022

    Nothing published for this version

  15. v1.5.1 05 Nov 2022

    Nothing published for this version

  16. v1.5.1-0.20221104150357-2744e70663e6 04 Nov 2022 pre-release

    Nothing published for this version

  17. v1.5.0 03 Nov 2022

    Nothing published for this version

  18. v1.4.4 22 Sep 2022

    Nothing published for this version

  19. v1.4.3 13 Sep 2022

    Nothing published for this version

  20. v1.4.2 19 Aug 2022

    Nothing published for this version

  21. v1.4.1 12 Aug 2022

    Nothing published for this version

  22. v1.4.0 12 Aug 2022

    Nothing published for this version

  23. v1.3.2-0.20220503231556-c519059cfa63 03 May 2022 pre-release

    Nothing published for this version

  24. v1.3.2-0.20220424101759-c00790f349c4 24 Apr 2022 pre-release

    Nothing published for this version

  25. v1.3.1 20 Apr 2022

    Nothing published for this version

  26. v1.3.0 13 Apr 2022

    Nothing published for this version

  27. v1.2.2 08 Apr 2022

    Nothing published for this version

  28. v1.2.1 27 Mar 2022

    Nothing published for this version

  29. v1.2.1-0.20220315183609-34b1fa7b1ca2 15 Mar 2022 pre-release

    Nothing published for this version

  30. v1.2.0 15 Mar 2022

    Nothing published for this version

  31. v1.1.1-0.20220312162251-e35874a0b031 12 Mar 2022 pre-release

    Nothing published for this version

  32. v1.1.1-0.20220304141120-45aada57e880 04 Mar 2022 pre-release

    Nothing published for this version

  33. v1.1.1-0.20220304011139-44d5878b011b 04 Mar 2022 pre-release

    Nothing published for this version

  34. v1.1.1-0.20220220161908-7bec22d8e3fa 20 Feb 2022 pre-release

    Nothing published for this version

  35. v1.1.1-0.20220220154919-6900c1fdf3a2 20 Feb 2022 pre-release

    Nothing published for this version

  36. v1.1.1-0.20220103194347-7411d3930522 03 Jan 2022 pre-release

    Nothing published for this version

  37. v1.1.1-0.20211225171117-501665b6dda4 25 Dec 2021 pre-release

    Nothing published for this version

  38. v1.1.1-0.20211225170343-b825cc77de28 25 Dec 2021 pre-release

    Nothing published for this version

  39. v1.1.1-0.20211225170125-a6d3dc1a9409 25 Dec 2021 pre-release

    Nothing published for this version

  40. v1.1.1-0.20211225034604-275a6a9dbeab 25 Dec 2021 pre-release

    Nothing published for this version

  41. v1.1.1-0.20211224172409-40e5f803476c 24 Dec 2021 pre-release

    Nothing published for this version

  42. v1.1.0 18 Dec 2021

    Nothing published for this version

  43. v1.0.1 15 Dec 2021

    Nothing published for this version

  44. v1.0.1-0.20211215020521-1f729fa14b1b 15 Dec 2021 pre-release

    Nothing published for this version

  45. v1.0.1-0.20211215015416-54726ba2a769 15 Dec 2021 pre-release

    Nothing published for this version

  46. v1.0.1-0.20211212110029-77a63d5b7953 12 Dec 2021 pre-release

    Nothing published for this version

  47. v1.0.0 10 Dec 2021

    Nothing published for this version

  48. v0.7.2-0.20211224171800-efe71b1652a1 24 Dec 2021 pre-release

    Nothing published for this version

  49. v0.7.2-0.20211224162836-5d678512b68a 24 Dec 2021 pre-release

    Nothing published for this version

  50. v0.7.2-0.20211218005449-cbb03286d2f2 18 Dec 2021 pre-release

    Nothing published for this version

  51. v0.7.2-0.20211215020658-4d48ed30a061 15 Dec 2021 pre-release

    Nothing published for this version

  52. v0.7.2-0.20211211132910-4215444137fc 11 Dec 2021 pre-release

    Nothing published for this version

  53. v0.7.2-0.20211210232212-09f10b302a78 10 Dec 2021 pre-release

    Nothing published for this version

  54. v0.7.2-0.20211210231906-5fcebaaa7384 10 Dec 2021 pre-release

    Nothing published for this version

  55. v0.7.2-0.20211204160815-0601e1ff3d2c 04 Dec 2021 pre-release

    Nothing published for this version

  56. v0.7.2-0.20211204155754-b523c7a221e1 04 Dec 2021 pre-release

    Nothing published for this version

  57. v0.7.2-0.20211129231429-6e0be41e3864 29 Nov 2021 pre-release

    Nothing published for this version

  58. v0.7.2-0.20211126230026-6e50203fe13e 26 Nov 2021 pre-release

    Nothing published for this version

  59. v0.7.1 26 Nov 2021

    Nothing published for this version

  60. v0.7.0 26 Nov 2021

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive