In this post, we will explore how Unix pipes are implemented in Linux by iteratively optimizing a test program that writes and reads data through a pipe.1 We will begin with a simple program with a throughput of around 3.5GiB/s, and improve its performance twentyfold. The improvements will be informed by profiling the program using Linux’s perf tooling.2 The code is available on GitHub. The post w
![How fast are Linux pipes anyway?](https://cdn-ak-scissors.b.st-hatena.com/image/square/267bb9df8837b8c93c6e595dc3972937996ec87d/height=288;version=1;width=512/https%3A%2F%2Fmazzo.li%2Fassets%2Fimages%2Ffast-pipes-cover.png)