Why is it cheating to use a buffer? This is the behavior you would get in C if you used the C standard library (putc/fputc) instead of a system call (write).
Because it doesn't answer the question "how fast individual languages write individual characters to a pipe" if in fact some languages do not.
It's not language "cheating" of course. It's just OP "measuring the wrong thing".
Re:How fast are Linux pipes anyway?
by chupasaurus on Thursday June 02, 2022 @07:29PM
(#31601954)
If you want to compare apples to apples, you can switch Python to use unbuffered stdout/stderr (via `-u` or fcntl inside the script [0])
Python cheats, and it's still slow as heck even while cheating (buffers the output at 8192 chunks instead of issuing 1 byte writes).
write(1, "1", 1) loop in C pushes 6.38MiB/s on my PC. :)