3 ms·
In my experience, almost every case of trying to replace arrays with bitsets resulted in worse performance. Indexing arrays is definitely faster. Bitsets also
by superpermutat0r 8y ago
In 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.