danielgtaylor / danielgtaylor/python-betterproto
Rendering comments can be time consuming.
- Lenguaje dominante
- Python
- Estrellas
- 1.8k
- Forks
- 234
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
```
$ time protoc -I . --python_betterproto_out=. douyin2.proto |& head
Writing __init__.py
Writing douyin\__init__.py
real 6m18.150s
user 0m0.015s
sys 0m0.091s
```
After patching `betterproto/plugin/models.py@ProtoContentBase.comment` to return empty string, it's much faster
```
$ time protoc -I . --python_betterproto_out=. douyin2.proto |& head
Writing __init__.py
Writing douyin\__init__.py
real 0m23.077s
user 0m0.000s
sys 0m0.092s
```
Profile flamegraph from `py-spy record`
Guía de contribución
Línea de trabajo
Start in betterproto/plugin/models.py at ProtoContentBase.comment and use the reported py-spy profile to identify why comment rendering dominates protoc generation. Compare generation against the provided timing example, then verify that comments remain correct while the reported slowdown is substantially reduced.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- devtools, performance
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Tranquilo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 55/100