3 ms·
There's a point where printing progress is actually a huge bottleneck to performance. Try it out in python. Make a for loop that loops a million times and print
by ythn 10y ago
There's a point where printing progress is actually a huge bottleneck to performance. Try it out in python. Make a for loop that loops a million times and prints "Hello". Run the program once normally, and a second time piping the output to a file. You'll find the first one takes 15 seconds, while the second one is near instantaneous.
- goldenkek 10y agoThis is a false equivalence. As long as the progress is set correctly via messaging (queue) to an alternate UI thread, the time lost will be under a millsecond. The naive print loop you provide is obviously IO bound and print is a blocking IO call. Use an async print IO and youll have much better performance. Narf!!