trio icon indicating copy to clipboard operation
trio copied to clipboard

use of locals() / f_locals() foils pypy

Open belm0 opened this issue 3 years ago • 0 comments

Mutation via locals(), f_locals() causes pypy to abort traces with "force quasi-immut". Trio does this to manage KI protection state, and the most common API calls like current_time() are implicated. So pypy spends a lot of time compiling traces, only to abort them.

some ideas for fixing discussed on gitter starting at https://gitter.im/python-trio/general?at=6357f654cf41c67a5cc9b993

NOTE: a tracing JIT like PyPy is not going to do well anyway with async apps that have a high rate of context switches combined with heterogenous workloads, since the tracing will happen across context switches to other coroutines (which are arbitrarily occurring and arbitrarily ordered).

belm0 avatar Oct 26 '22 04:10 belm0