4 ms·
I agree a bitset is probably a better use here, but this may be a case where the requirements or actual usage numbers tilt the design this way? I'm guessing if
by pbnjay 12y ago
I agree a bitset is probably a better use here, but this may be a case where the requirements or actual usage numbers tilt the design this way?
I'm guessing if the size of the vector is very large, and the set bits are very sparse, then this threshold counter idea would be faster. But that would beg the question of why a bitset and tracked offsets (similar to the other idea mentioned in the article) wouldn't be fast either. Especially considering the caching effects of the bitset.