splice

Tag

Cards List
#splice

Zero-copy in Go: sendfile, splice, and the cost of io.Copy

Hacker News Top · 2026-07-05 Cached

This article explains how Go's io.Copy automatically uses sendfile and splice for zero-copy file transfers over TCP, and demonstrates how wrapping a file in a plain io.Reader—e.g., for logging—quietly disables this optimization, causing a significant performance drop. Benchmarks and strace output illustrate the impact.

0 favorites 0 likes
← Back to home

Submit Feedback