File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1552,10 +1552,17 @@ mark_at_start(PyThreadState *tstate)
15521552static Py_ssize_t
15531553assess_work_to_do (GCState * gcstate )
15541554{
1555- /* The amount of work we want to do depends on two things.
1555+ /* The amount of work we want to do depends on three things.
15561556 * 1. The number of new objects created
15571557 * 2. The growth in heap size since the last collection
15581558 * 3. The heap size (up to the number of new objects, to avoid quadratic effects)
1559+ *
1560+ * For a steady state heap, the amount of work to do is three times the number
1561+ * of new objects added to the heap. This ensures that we stay ahead in the
1562+ * worst case of all new objects being garbage.
1563+ *
1564+ * This could be improved by tracking survival rates, but it is still a
1565+ * large improvement on the non-marking approach.
15591566 */
15601567 Py_ssize_t scale_factor = gcstate -> old [0 ].threshold ;
15611568 if (scale_factor < 2 ) {
You can’t perform that action at this time.
0 commit comments