3 ms·
Quite some time ago (~15 years?), I needed to repeatedly recompile SBCL from scratch, a process that produced multiple megabytes of output per second. I found t
by thequux 4y ago
Quite some time ago (~15 years?), I needed to repeatedly recompile SBCL from scratch, a process that produced multiple megabytes of output per second. I found that the gnome-terminal (which I was using at the time) increased compile time by ~4x relative to redirecting the output to /dev/null. Xterm only increased compile time by ~20%, but rxvt-unicode had no measurable overhead, so I switched over and only reconsidered when it became fashionable for CLI tools to use emoji in their output.
- Groxx 4y agoStdout is frequently buffered slightly, but yeah, once you exceed it your `print(...)` line becomes blocking, and the execution moves to your terminal until it displays or discards it, freeing room in that buffer. With large amounts of output, that can be a massive amount of time. As a really simple example, try `time dd if=/dev/random bs=1k count=1000` to print a megabyte of random data, vs `... > /dev/null`.
- bee_rider 4y agoWhat about redirecting to a file? I would be worried that my eyeballs might not even be able to keep up with megabytes per second, so having the output in a file would seem more useful anyway.