3 ms·
I'm a bit skeptical that bitsets are more performant than arrays, indexing arrays should be superiorly faster.
by superpermutat0r 8y ago
I'm a bit skeptical that bitsets are more performant than arrays, indexing arrays should be superiorly faster.
- steveklabnik 8y agoWhy?
- superpermutat0r 8y agoIn my experience, almost every case of trying to replace arrays with bitsets resulted in worse performance. Indexing arrays is definitely faster. Bitsets also do array indexing but have to target particular bits too. If I want to index 1309402 bit, I have to calculate where it is in memory, for an array representing a bit, it's super quick. Rarely have I encountered that memory occupied by an array is a bottleneck.