2 ms·
What's the point of "safety" if it's not needed anymore, as it seems not to be under nogil? If that's right, then modulo regressions/bugs possibly introduced by
by lgessler 4y ago
What's the point of "safety" if it's not needed anymore, as it seems not to be under nogil? If that's right, then modulo regressions/bugs possibly introduced by nogil, the choice is really just between worse or better performance, and it's not important whether there are (more effortful, by the way) ways of getting much much better performance.
Moreover, to the point about writing performance-critical sections in $NOT_PYTHON, as Sam Gross explains in the nogil design doc, things aren't always so straightforward for scientific computing:
> Calling into Python from C requires acquiring the GIL -- even short snippets of Python code can inhibit scaling. Addressing this issue sometimes requires rewriting large portions of Python code in C/C++ to actually achieve the desired parallelism. For example, PyTorch rewrote all of the core automatic differentiation from Python to C++ to avoid acquiring the GIL in the backward pass.