2 ms·
I'd love to see performance numbers for this, if they're available. My hunch is that indexing cost would be about the same.
by ufo 2y ago
I'd love to see performance numbers for this, if they're available. My hunch is that indexing cost would be about the same.
- manwe150 2y agoThey both have an offset, but ring buffers aren’t contiguous so they also need a branch or modulus to handle wrap around. Either can be cheap, but clearly that is strictly more costly than not having the extra operation (even if very little). Only matters for random indexing also, since for mutation the situation is swapped
- ufo 2y agoThere are many situations where those little differences completely vanish because of instruction pipelining. Only way to know is to actually measure it.