Timeline for Palindrome test
Current License: CC BY-SA 4.0
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 8, 2019 at 20:33 | comment | added | Alexander | @Deduplicator I didn't know that about the error stream, good to know. "But not flushing after every line can also help significantly, even be an order of magnitude or more." but still, it doesn't matter. You shouldn't be printing in a tight loop if performance is an issue. Buffering or not, you shouldn't be doing it at all. | |
| Jul 8, 2019 at 20:19 | comment | added | Deduplicator | @Alexander Not printing at all is certainly faster. But not flushing after every line can also help significantly, even be an order of magnitude or more. The error-stream is unbuffered because there complete output until the crash is paramount. | |
| Jul 8, 2019 at 20:14 | history | edited | Deduplicator | CC BY-SA 4.0 |
added 215 characters in body
|
| Jul 8, 2019 at 17:49 | comment | added | Alexander | "You should desist from using std::endl, as spurious manual flushing flushes any pretense at performance down the drain." I can't imagine a context in which this would be an issue. If performance is an issue (e.g. printing in a loop), you shouldn't be printing at all. If performance isn't an issue, there's no reason to delay flushing. It could be useful for when debugging a loop, for example. If your program crashes, you know that your log provides an accurate trace of what happened, because all prints were flushed. | |
| Jul 7, 2019 at 19:05 | history | answered | Deduplicator | CC BY-SA 4.0 |