| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Sorry, something went wrong.
If the object is already marked as reachable, we shouldn't traverse it again.
These are not strictly needed, simplify PR.
More code cleanup (better names, comments, simplify error handling). Fix bug in that "alive" bit must be checked in mark_alive_stack_push() to avoid visiting already visited objects.
Make sure we still do this optimization. There is also a unit test that checks for this.
Reduces duplicate code.
There was a problem hiding this comment.
Looks great! A few comments below
Sorry, something went wrong.
Use gc_abort_mark_alive() helper in case of OOM. In addition to freeing the stack, we need to ensure that no object has the alive bit set on it. This also adding missing error handling in the case that propagate_alive_bits() fails.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This is conceptually similar to the phase that was added to the non-free-threaded GC. Start with a set of known root objects, like sysdict and mark all objects reachable from those (revealed by the tp_traverse method) as "alive". We know anything marked alive cannot be garbage and can be excluded from the regular cyclic GC process. For most programs, this saves a moderate amount of computation since the marking pass is relatively cheaper per object.
If gc.freeze() is used, it's unlikely that this marking phase will be a win since it's expected that the majority of objects will be frozen. Disable the marking phase if freeze is used.
See gh-126491 for the non-free-threaded version of this technique.
pyperformance results vs merge base. I suspect the slowdown on some benchmarks is not real. For example, regex_v8 should not be slower.
Here are the pyperformance results for a bare-metal AMD Ryzen machine. It does not show a slowdown on regex_v8, for example.
To better show the expected improvement, I ran a "sphinx build" benchmark, like in gh-124567. Results are: