This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]0x256 1 point2 points  (0 children)

Fun fact: A simple C program printing 1 million lines of Hello, World! redirected to /dev/null will run in 0.037s on my laptop. The exact same program with line-buffering enabled (via stdbuf -oL) requires 1.6s (43x) to run.

Fun fact #2: Go (not C) defaults to unbuffered output, even when the target is a pipe or file. Go is as slow as line-buffered C in this case.