You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[mypyc] Avoid cyclic reference in nested functions (#16268)
Mypyc used to always put nested functions into the environment object,
which results in cyclic references, since the function object contains a
reference to the environment.
Now we only do this if the body of a nested function refers to a nested
function (e.g. due to a recursive call). This means that in the majority
of cases we can avoid the cyclic reference.
This speeds up self check by an impressive 7%. I'm not sure exactly why
the impact is so big, but spending less time in the cyclic garbage
collector is probably a big part.
0 commit comments