Grokking Operating Systems and Networking for Backend Engineers
0% completed
Zero Copy With Sendfile
Checkout keeps its order receipts as files. Every night, a reporting job downloads a 1 GB archive of them. The same 1 GB file was sent over a local connection in three ways, and the sending program printed what each way cost:
Output:
read-write sent 1024 MB in 0.38 s user CPU 0.01 s system CPU 0.38 s system calls 32768 sendfile sent 1024 MB in 0.19 s user CPU 0.00 s system CPU 0.07 s system calls 1 splice sent 1024 MB in 0.20 s user CPU 0.00 s system CPU 0.09 s system calls 32768
The first way is an ordinary loop of read and write calls
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%