3 ms·
FTA: Now imagine what that means if we need to loop over 1000 columns? It does create some non-trivial overhead. I would guess cache misses have a larger effec
by Someone 4y ago
FTA: Now imagine what that means if we need to loop over 1000 columns? It does create some non-trivial overhead.
I would guess cache misses have a larger effect than the bit twiddling needed to walk to the nth item in each row.
A way to sort-of test that would be by using a table that fits in cache and repeating the query. The noise on time measurement might make that difficult, though.
- anarazel 4y agoBoth are significant. But the bit twiddling definitely shows up. There's some caching to avoid it in some situations, and breaking that causes measurable slowdowns. In the end it's not too surprising - a good number of columns fit in a cache line, and adjacent lines can easily be prefetched. The cache miss matters a lot for the first column / row header, but not that much after.