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] Support explicit acyclic native classes that avoid gc (#20795)
Use `@mypyc_attr(acyclic=True)` so that instances of the class don't
participate in cyclic gc. This sped up a microbenchmark that just
allocates lots of temporary objects by ~60%. Acyclic instances also
use less memory, since there is no GC header.
I did some manual testing beyond the added tests to ensure acyclic
classes work as expected.
We can later add support for inferring acyclicity automatically in some
cases, but usually it will have to be explicitly declared.
This was created using Claude Code.
0 commit comments