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
For a unreachable cycle to be be formed the refcount of the last reachable object in the cycle must drop to a non-zero value.
All objects whose reference counts drops to a non-zero value are thus candidate roots of cycles.
We can exploit this, when performing GC by only creating increments from candidate roots.
Since 5 in 6 decrefs are to non-zero, almost all objects would end up as candidate roots anyway, and it would add significant cost to DECREF operations.
However, with deferred reference counting the numbers change a lot.
With deferred RC, only about a third of DECREFs will leave the RC > 0.
The additional cost of marking objects as candidate roots would be much lower, and the effectiveness of cycle GC much increased.
For a unreachable cycle to be be formed the refcount of the last reachable object in the cycle must drop to a non-zero value.
All objects whose reference counts drops to a non-zero value are thus candidate roots of cycles.
We can exploit this, when performing GC by only creating increments from candidate roots.
Since 5 in 6 decrefs are to non-zero, almost all objects would end up as candidate roots anyway, and it would add significant cost to
DECREF
operations.However, with deferred reference counting the numbers change a lot.
With deferred RC, only about a third of
DECREF
s will leave the RC > 0.The additional cost of marking objects as candidate roots would be much lower, and the effectiveness of cycle GC much increased.
The algorithm
GC:
The text was updated successfully, but these errors were encountered: