Improving GC collections: dynamic thresholds, single generation gc and time barriers
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 20/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- python
- Área
- backend, performance
Línea de trabajo
Comience revisando las observaciones del benchmark en este issue y el PR gh-100958 enlazado. El trabajo propuesto consiste en comparar la estrategia generacional actual con una sola generación y umbrales dinámicos; para completarlo sería necesario decidir un enfoque respaldado por resultados de rendimiento, pero aquí no se nombran archivos ni pruebas específicos.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
In the pursuit of trying to optimize GC runs it has been observed that the weak generational hypothesis may not apply that well to Python. This is because, according to this argument, in the presence of a mixel cycle GC + refcount GC strategy, young objects are mostly cleaned up by reference count, not by the GC. Is important as well that there is no segregation between the GC strategies and that the cycle GC needs to deal with objects that according to this will be mainly cleaned up by reference count alone.
This questions the utility of segregating GC by generations and indeed there is some evidence of this. I have been benchmarking the percentage of success of different generations in some programs (such as blach and mypy and a bunch of HTTP servers) and the success rate of the lower generations is generally small. Here is an example of running black over all the standard library:
Statistics for generation 0
| Category | Value |
|---|---|
| count | 157917.000000 |
| mean | 1.192775 |
| std | 3.560391 |
| min | 0.000000 |
| 25% | 0.000000 |
| 50% | 0.000000 |
| 75% | 0.480192 |
| max | 86.407768 |
Statistics for generation 1
| Category | Value |
|---|---|
| count | 14346.000000 |
| mean | 2.670852 |
| std | 11.642815 |
| min | 0.000000 |
| 25% | 0.000000 |
| 50% | 0.000000 |
| 75% | 0.388794 |
| max | 97.406097 |
Statistics for generation 2
| Category | Value |
|---|---|
| count | 1280.000000 |
| mean | 45.698135 |
| std | 27.066735 |
| min | 0.000000 |
| 25% | 31.965862 |
| 50% | 54.618008 |
| 75% | 67.038842 |
| max | 90.592705 |
I am currently investigating if having a single generation with a dynamic threshold that is similar to the strategy that we use currently for the last generation would be generally better to get better performance.
What do you think?
Linked PRs
- gh-100958
- Lenguaje dominante
- Python
- Estrellas
- 77.2k
- Forks
- 36k
- Merge medio
- 1 d 9 h
- PR fusionados (30 d)
- 558
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de python/cpython
-
docs pending
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
stdlib type-feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
stdlib type-feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
build type-bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
stdlib topic-email type-feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Todos los issues de python/cpython
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
zostera/django-bootstrap4#894 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
use-agent-os/agent-os#3276 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
NousResearch/hermes-agent#117848 ·