A collection of useful, performant, and threadsafe data structures implemented in Go.
go-datastructures is a comprehensive collection of data structures implemented in Go that are designed to be useful, performant, and thread-safe. It provides implementations of both common and specialized data structures like augmented trees, tries, queues, heaps, and persistent collections, solving the problem of needing reliable concurrent data structures in Go applications.
Go developers building concurrent applications who need reliable, high-performance data structures beyond the standard library offerings, particularly those working on systems requiring thread-safe operations and specialized collection types.
Developers choose go-datastructures because it offers production-ready, battle-tested implementations of complex data structures with a focus on concurrency safety and performance optimization, filling gaps in Go's standard library while maintaining idiomatic Go APIs.
A collection of useful, performant, and threadsafe Go datastructures.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Structures like MPMC queues and Ctrie are designed for safe concurrent access, solving common Go patterns without channel limitations, as noted in the Futures and Queue package descriptions.
Includes rare implementations like augmented trees for n-dimensional collision detection and Fibonacci heaps with cheap decrease-key ops, filling gaps in Go's ecosystem for graph algorithms.
Benchmarks show multithreaded bucket sort can be 3x faster than native Go sort, and bitarrays provide space-efficient existence checks without hashing overhead.
Offers a wide range from persistent tries to concurrent hash maps, reducing the need to integrate multiple libraries for different data structure needs in production.
The B+ tree lacks a delete method and is noted as needing optimization, and some structures like the Fibonacci heap are not thread-safe, limiting out-of-the-box use.
README admits skiplists can have 'far worse' performance than BBSTs due to 'shadow' effects, and interface overhead in B-trees causes significant CPU profiling issues.
With many specialized structures, developers must understand specific limitations, such as augmented trees having suboptimal time complexity in extra dimensions or persistent structures being slower for writes.