4 ms·
Maybe so, but, as pointed out elsewhere in the thread, printing to stdout is much, much, much, much slower than printing to a file. The fact that stdout is a fi
by thaumasiotes 10y ago
Maybe so, but, as pointed out elsewhere in the thread, printing to stdout is much, much, much, much slower than printing to a file. The fact that stdout is a file descriptor can only explain a vanishingly small quantity of the time cost of using it.
- goldenkek 10y agoblocking. blocking. blocking. blocking. rtfm
- thaumasiotes 10y agoAgain, the problem is not that writing to file descriptors is blocking. The problem is that writing to the screen is very slow. Writing to a file is just as blocking, but you'll block for much less time, because writing to a file is not slow.
- anthk 10y ago2>&1>/dev/null
- arjie 10y agoIt's a combination of many things. You're probably writing to a file buffered, but terminal writes are generally unbuffered. In addition, I had a terminal setup once that just did a poor job of displaying text (line wrapping was slow, perhaps) and programs that would write out to stdout would be slow.
- majewsky 10y ago> printing to stdout is much, much, much, much slower than printing to a file False dichotomy. stdout can very well be a file. What you mean is that printing to a terminal is slower than to a file.
- thaumasiotes 10y agoTrue enough.