logoalt Hacker News

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

44 pointsby mrngmtoday at 8:24 PM8 commentsview on HN

Comments

inigyoutoday at 11:37 PM

This is almost like the expression problem. Copy is a new operation, and you introduced a new type, thus creating a new grid cell nobody from either side could have reasonably known about - except for the fact Copy is in the standard library so you could have known about it but not done anything.

sanxiyntoday at 10:28 PM

A good reminder. It is surprising first time you encounter it.

Same for Rust. As https://doc.rust-lang.org/stable/std/io/fn.copy.html says, std::io::copy can use copy_file_range(2), sendfile(2), or splice(2).

mike_hocktoday at 10:30 PM

Zero-Copy in Go: Why magic is an antipattern, and: performance is observable behavior.

show 1 reply
joaohaastoday at 11:13 PM

Interesting premise for a post, but I had to stop midway due to the AI slop writing adding meaningless information.

throwrioawfotoday at 10:44 PM

Ugh, AI slop writing.

show 1 reply