GitHub - dronnix/bwarr: Black-White Array: fast, ordered data structure based on arrays with O(log N) memory allocations

Hacker News
February 22, 2026
AI-Generated Deep Dive Summary
The Black-White Array (BWArr) is a groundbreaking, high-performance data structure designed for efficient handling of dynamic datasets. Unlike traditional structures, BWArr offers O(log N) memory allocations for insertions, minimizing garbage collection pressure while maintaining fast operations like search, delete, and iteration with amortized time complexity of O(log N). This array-based, pointerless design ensures optimal CPU utilization by leveraging cache locality and sequential processing, making it ideal for real-time systems and applications requiring frequent data modifications. BWArr stands out as a drop-in replacement for popular libraries such as Google's BTree and GoLLRB, offering similar functionality with lower memory overhead. Its native support for duplicate elements simplifies multiset operations without the need for complex wrapping mechanisms. The structure is particularly efficient for batch operations, though it currently remains under development. Benchmarks reveal that BWArr performs exceptionally well in insertions compared to Google's BTree, while search and iteration operations remain competitive across various use cases. For real-time applications with large datasets, BWArr may introduce latency spikes during bulk deletions or series of calls, which could be managed using asynchronous processing. Smaller datasets might experience slightly longer search and delete times, though the trade-offs are negligible given its overall efficiency. Despite these considerations,
Verticals
techstartups
Originally published on Hacker News on 2/22/2026