4 ms·
Is the obsession with avoiding memory copying really justified? I'd like to see some data. Is this really a bottleneck in modern systems? Is TLS a bottleneck at
by api 9y ago
Is the obsession with avoiding memory copying really justified? I'd like to see some data. Is this really a bottleneck in modern systems? Is TLS a bottleneck at all for most work loads?
- justincormack 9y agoMemory bandwidth still matters, yes. Cache sizes are still not very big, and a copy uses more cache. Obviously you may have other bottlenecks first, but it matters once you are using 10Gb ethernet or faster, for example.
- api 9y agoThat's a good point. It's probably more a cache thing than a CPU cycles thing and that might not show up on a straightforward CPU profile. What would happen if you used special instructions to try to implement a non-cache-polluting memcpy? Or is that even possible? It's been a while but I seem to think that modern CPUs have a variety of cache control instructions. Zero copy is great but it can be a PITA.
- justincormack 9y agoYou have to use at least one cache line for memcpy. But you need more for pipelining the accesses probably to get good speed. Benchmarking memcpy though is complicated.
- wmf 9y agoIIRC Netflix found TLS to be a bottleneck when serving 100 Gbps of static content over HTTPS, but that's an unusual case. The kTLS paper showed pretty small speedups, so maybe the real motivation is TLS hardware offload.