tidwall

tidwall / btype

Public

B-tree based collection types for Go

31
0
100% credibility
Found May 10, 2026 at 31 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
Go
AI Summary

btype offers high-performance, B-tree-based collection types for Go, such as sorted maps, sets, dynamic arrays, tables, stacks, queues, deques, and priority queues, with features like instant copy-on-write snapshots and O(log n) operations.

How It Works

1
🔍 Need fast data handling

You're creating an app that juggles lots of information like names, numbers, or tasks, and you want it sorted and lightning-quick to find or update.

2
📦 Discover btype

You stumble upon btype, a handy kit of super-speedy organizers for keeping your data neatly sorted and easy to manage.

3
🛠️ Bring it into your project

You easily slip these organizers into your app with a quick, painless step.

4
Pick and fill your organizer

Choose the perfect one – like a sorted phone book, a to-do stack, or a waiting line – then add, search, tweak, or remove items in a blink.

5
📋 Make safe copies

Instantly duplicate your full organizer to test changes without risking your original data.

🎉 Blazing-fast app

Your app now smoothly handles mountains of data, staying sorted and speedy no matter how much you throw at it.

Sign up to see the full architecture

4 more

Sign Up Free

Star Growth

See how this repo grew from 31 to 31 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is btype?

btype delivers B-tree powered collections for Go, including sorted Maps, Sets, dynamic Arrays with O(log n) random access, Tables for custom-sorted data, plus Stack, Queue, Deque, and priority queues. It solves the need for high-performance, ordered data structures that support fast inserts, deletes, range queries, and iteration from any point. Users get copy-on-write snapshots in O(1) time, enabling cheap branching without deep copies.

Why is it gaining traction?

Benchmarks show it beating Go's google/btree and tidwall/btree, plus Rust's BTreeMap and C++ b-tree implementations on insert/get ops for ints, uints, and strings. The API feels modern with Go generics, iterator ranges like Ascend(key) for >= queries, and struct tags for Table keys (e.g., `btype:"key,desc"` for sorting). O(log n) everything, including mid-array inserts, hooks devs seeking b-tree github alternatives without perf tradeoffs.

Who should use this?

Backend Go engineers building in-memory stores, caches, or indexes where order and snapshots matter, like event logs or leaderboards. Database devs prototyping sorted collections or needing priority queues with duplicates. Anyone tired of stdlib slices/maps for large datasets requiring fast range deletes or seeks.

Verdict

Grab it for perf-critical sorted collections—exhaustive tests hit 100% coverage, docs cover APIs/examples well. At 31 stars and 1.0% credibility, it's early-stage from a proven author; run your own benchmarks before prod.

(198 words)

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.