Francesco Mazzoli delves
deeply into the kernel’s implementation of pipes (and more) in an
attempt to maximize the throughput of data.
The post was inspired by reading a highly optimized FizzBuzz
program, which pushes output to a pipe at a rate of ~35GiB/s on my
laptop. Our first goal will be to match that speed, explaining
every step as we go along. We’ll also add an additional
performance-improving measure, which is not needed in FizzBuzz
since the bottleneck is actually computing the output, not IO, at
least on my machine.
Source: LWN.net – Mazzoli: How fast are Linux pipes anyway?