GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — GH-126491: Lower heap size limit with faster marking by markshannon · Pull Request #127519 · python/cpython Conversation
|
|
!buildbot iOS |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
🤖 New build scheduled with the buildbot fleet by @markshannon for commit 8893cf5 🤖 The command will test the builders whose names match following regular expression: The builders matched are:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
!buildbot Android |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
🤖 New build scheduled with the buildbot fleet by @markshannon for commit 8893cf5 🤖 The command will test the builders whose names match following regular expression: The builders matched are:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
!buildbot Android|iOS |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
🤖 New build scheduled with the buildbot fleet by @markshannon for commit 8262bf0 🤖 The command will test the builders whose names match following regular expression: The builders matched are:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Performance is a wash overall, but I think that is an artifact of our benchmarks. I would expect this to perform better on larger heaps and consume less memory, although the benchmarks show no overall change in memory consumption. Note that the "create gc cycles" benchmark shows a 10% speedup and "gc traversal" an 8% speedup, but there is an equivalent slowdown on the "xml etree" benchmarks. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
|
||
| To work out how much work we need to do, consider a heap with `L` live objects | ||
| and `G0` garbage objects at the start of a full scavenge and `G1` garbage objects | ||
| at the end of the scavenge. We don't want amount of garbage to grow, `G1 ≤ G0`, and |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| at the end of the scavenge. We don't want amount of garbage to grow, `G1 ≤ G0`, and | |
| at the end of the scavenge. We don't want the amount of garbage to grow, `G1 ≤ G0`, and |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| The number of new objects created `N` must be at least the new garbage created, `N ≥ G1`, | ||
| assuming that the number of live objects remains roughly constant. | ||
| If we set `T == 4*N` we get `T > 4*G1` and `T = L + G0 + G1` => `L + G0 > 3G1` | ||
| For a steady state heap `G0 == G1` we get `L > 2G` and the desired garbage ratio. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| For a steady state heap `G0 == G1` we get `L > 2G` and the desired garbage ratio. | |
| For a steady state heap `G0 == G1` we get `L > 2*G0` and the desired garbage ratio. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| The number of new objects created `N` must be at least the new garbage created, `N ≥ G1`, | ||
| assuming that the number of live objects remains roughly constant. | ||
| If we set `T == 4*N` we get `T > 4*G1` and `T = L + G0 + G1` => `L + G0 > 3G1` | ||
| For a steady state heap `G0 == G1` we get `L > 2G` and the desired garbage ratio. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| For a steady state heap `G0 == G1` we get `L > 2G` and the desired garbage ratio. | |
| For a steady state heap (`G0 == G1`) we get `L > 2G` and the desired garbage ratio. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| If we choose the amount of work done such that `2*M + I == 6N` then we can do | ||
| less work in most cases, but are still guaranteed to keep up. | ||
| Since `I ≥ G0 + G1` (not strictly true, but close enough) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| Since `I ≥ G0 + G1` (not strictly true, but close enough) | |
| Since `I ≈ G0 + G1` (not strictly true, but close enough) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The increments (I) can include some of the live heap, depending on the how much is keep alive by C extensions.
So ≥ is more correct. Although ≳ is even more correct.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| If we choose the amount of work done such that `2*M + I == 6N` then we can do | ||
| less work in most cases, but are still guaranteed to keep up. | ||
| Since `I ≥ G0 + G1` (not strictly true, but close enough) | ||
| `T == M + I == (6N + I)/2` and `(6N + I)/2 ≥ 4G`, so we can keep up. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| `T == M + I == (6N + I)/2` and `(6N + I)/2 ≥ 4G`, so we can keep up. | |
| `T == M + I == (6N + I)/2` and `(6N + I)/2 ≳ 4G`, so we can keep up. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| `T == M + I == (6N + I)/2` and `(6N + I)/2 ≥ 4G`, so we can keep up. | ||
|
|
||
| The reason that this improves performance is that `M` is usually much larger | ||
| than `I` Suppose `M == 10I`, then `T ≅ 3N`. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| than `I` Suppose `M == 10I`, then `T ≅ 3N`. | |
| than `I`. If `M == 10I`, then `T ≅ 3N`. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| assess_work_to_do(GCState *gcstate) | ||
| { | ||
| /* The amount of work we want to do depends on three things. | ||
| /* The amount of work we want to do depends on two things. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Is it worth linking to the doc from here?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
| intptr_t new_objects = gcstate->young.count; | ||
| intptr_t max_heap_fraction = new_objects*3/2; | ||
| intptr_t max_heap_fraction = new_objects*5; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Why is this called fraction?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Not for any good reason. I'll rename it.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This commit introduced reference leaks in |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ythonGH-127519)" This reverts commit 023b7d2, which introduced a refleak.
|
I filed a revert PR: #127770 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…127519) * Faster marking of reachable objects * Changes calculation of work to do and work done. * Merges transitive closure calculations
…faster marking (pythonGH-127519)" (pythonGH-127770) Revert "pythonGH-126491: Lower heap size limit with faster marking (pythonGH-127519)" This reverts commit 023b7d2, which introduced a refleak.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.