Improving representative benchmarks for typing ecosystem
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 1k
- Fork
- 203
- Merge medio
- 1h 20m
- PR unite (30g)
- 2
Descrizione
Due to a current lack of representative macrobenchmarks, it is very difficult to decide on whether complex accelerators for some parts of typing are worth implementing in the future. Hence, I'm trying to upstream some benchmarks into pyperformance.
IMO, there are three main areas:
- Performance of static type checkers implemented in Python (e.g. mypy). (Fixed by #102)
- Performance of programs using types at runtime (e.g. pydantic, attrs, etc.).
- Runtime overhead of typed code vs fully untyped code.
For case 2, I plan to use one of pydantic's benchmarks here https://github.com/samuelcolvin/pydantic/tree/master/benchmarks, installed without compiled binaries.
Case 3 is very tricky because there are so many ways to use typing. I don't know how often people use certain features, whether they type-hint inside tight loops, etc. So I'm struggling to find a good benchmark. An idea: grabbing one of the existing pyperformance benchmarks, fully type-hinting it, then comparing the performance delta may work.
CC @JelleZijlstra, I would greatly appreciate hearing your opinion on this (especially for case 3). Maybe I can post this on typing-sig too if I need more help.
Afterword:
All 3 cases benefit from general CPython optimizations. But usually only 3. benefits greatly from typing module-only optimizations (with 1. maybe not improving much if at all, depending on implementation).
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia esaminando le tre aree di benchmark descritte nell’issue e i benchmark pydantic esistenti collegati al suo interno. Confronta queste opzioni con l’attuale suite di benchmark di pyperformance, quindi chiarisci quali casi e programmi di benchmark dovrebbero essere inclusi. Il lavoro è completato quando è stato concordato un ambito rappresentativo di benchmark e i benchmark selezionati sono stati integrati upstream.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- performance
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100