From Numerical Cosmology to Efficient Bit Abstractions for the Standard Library
summary
Claims a reusable C++ bit abstraction library (sources on GitHub) that replaces vector<bool> with a bit_iterator/bit_reference/bit_pointer adapter over sequences of unsigned integers, exposes low‑level access (base/position/address), and leverages CPU intrinsics like popcnt to run standard algorithms dramatically faster: reported 100–3500× speedups for count/copy/sort on 100M bits (bench on i7), a rewritten reverse gives an ~86× improvement over vector<bool), and the work is proposed for standardization as P0237.
AI-written summary · about
chapters (11)
- 0:00Introduction and motivation
- 3:08From cosmology to bit manipulation
- 7:26Problems with standard bit tools
- 11:44Current state of bit manipulation in C++
- 22:55Introducing the BEAT library
- 28:17Designing bit iterators
- 35:54Defining bit behavior and types
- 45:12BEAT library capabilities
- 47:05Benchmarking BEAT performance
- 53:21Summary and future directions
- 58:04Q&A session
related talks
01h 31mDesigning a Slimmer Vector of C++ Variants
57mAdventures in SIMD-Thinking (part 1 of 2)
55mUsing Integers as Arrays of Bitfields a.k.a. SWAR Techniques
06mArithmetic in C++ Using Counting Pointers
56mBeginners Guide to C++'s Best Kept Secret -- std::algorithm
01h 03mCompute More in Less Time Using C++ Simd Wrapper Libraries
57mCache friendly data + functional + ranges = ❤️
01h 31mNew (& Old) C++ Standard Library Containers - How to Choose the Right Container in C++26 and Beyond
