How fast are Linux pipes anyway?
How fast are Linux pipes anyway?
mazzo.li How fast are Linux pipes anyway?
Pipes are ubiquitous in Unix --- but how fast can they go on Linux? In this post we'll iteratively improve a simple pipe-writing benchmark from 3.5GiB/s to 65GiB/s, guided by Linux `perf`.
2
comments
Quality post, thanks for sharing!
20 0 ReplyWe will proceed as follows:
- A first slow version of our pipe test bench;
- How pipes are implemented internally, and why writing and reading from them is slow;
- How the
vmsplice
andsplice
syscalls let us get around some (but not all!) of the slowness; - A description of Linux paging, leading up to a faster version using huge pages;
- The final optimization, replacing polling with busy looping;
- Some closing thoughts.
13 1 Reply