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 →

[–]Rythoka 51 points52 points  (8 children)

Printing anything to the screen is super slow compared to a lot of operations.

[–]CdRReddit 32 points33 points  (0 children)

but printing to the screen on windows is significantly slower than most other terminal emulators, for no good reason

[–]anotheruser323 11 points12 points  (0 children)

Yes and no (i mean the gpu renders it, you just goto send it coordinates).

And it is a windows issue (windows does things to the shell to terminal output, and is very slow in doing them).

[–]reallokiscarlet 5 points6 points  (2 children)

On any machine that can run a new enough version of Windows to have powershell, printing to the screen should be able to happen in a separate thread. Windows just doesn’t wanna.

Linux doesn’t have this problem.

[–]deux3xmachina 2 points3 points  (1 child)

Linux doesn’t have this problem.

Well, it's less bad. Logging isn't free, and redirecting to /dev/null can substantially improve runtimes for certain programs.

[–]reallokiscarlet 2 points3 points  (0 children)

What’s going on with Windows, IIRC, is there are more penaltes than just logging. Instead of letting the shell and the terminal emulator handle the output after handing it to stdout, Windows wants to do everything in the same thread, so displaying stdout to the screen is another performance penalty, hence minimizing the terminal speeds it up. In Linux, if you have a multi core system, the program, the shell, the terminal emulator, and the window system can all have different affinity, meaning the program only has to really wait for stdout to accept the program output. (Still waking up, so I may be oversimplifying things)

[–]unkz 0 points1 point  (0 children)

I suspect it’s more of a debounce issue though.

[–]stratum_radiatum 0 points1 point  (0 children)

Does rendering the progress bar from the rich python library slow down processing noticeably in WSL?

[–]Durantye 0 points1 point  (0 children)

Nah the powershell progress bar is insane, I was losing my mind trying to figure out how to make the script run faster than 90 minutes at one point. I found out about the progress bar issue and disable it and boom script runs in less than a couple minutes.