4 ms·
"Copy-based APIs are not ideal but they seem to be hard to avoid." If everything resides in CPU L1 cache, it hardly matters at all. Other than L1 cache pressur
by vardump 5y ago
"Copy-based APIs are not ideal but they seem to be hard to avoid."
If everything resides in CPU L1 cache, it hardly matters at all. Other than L1 cache pressure, of course.
Other example is copying DMA transferred data followed by immediately consuming said data. Also in this case, the copy often effectively just brings the data to the CPU cache and the consuming code reads from cache. Of course it does increase overall memory write bandwidth use when the cache line(s) are eventually evicted, but total performance degradation can be pretty minimal for anything that fits in L1.