←back to thread

220 points wonger_ | 2 comments | | HN request time: 0s | source
Show context
aranelsurion ◴[] No.42186730[source]
> Python version is super laggy, something to do with OpenCV

Most probably I'm wrong, but I wonder if it has anything to do with all the text being written to stdout. In the odd chance that it happens on the same thread, it might be blocking.

replies(2): >>42186797 #>>42191871 #
1. ikanreed ◴[] No.42186797[source]
Could it then be resolved by using the no-gil version of python they just released?
replies(1): >>42186900 #
2. mananaysiempre ◴[] No.42186900[source]
I’m not sure what your reasoning is, but note that blocking I/O including print() releases the GIL. (So your seemingly innocent debugging print can be extremely not harmless under the wrong circumstances.)