danielgtaylor / danielgtaylor/python-betterproto
Rendering comments can be time consuming.
- Lingua principale
- Python
- Stelle
- 1.8k
- Fork
- 234
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
```
$ 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`
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- devtools, performance
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 55/100