`_PyStaticCode_InternStrings` is called ~800 times during startup.
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Refactoring
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Ambito
- backend, performance
Direzione di ricerca
Inizia tracciando _Py_Deepfreeze_Init() e le relative chiamate a _PyStaticCode_InternStrings. Esamina come vengono inizializzati il dizionario delle stringhe internate e i codici hash delle stringhe, quindi determina se la costruzione in blocco proposta preserva lo stato richiesto del dizionario e il comportamento all’avvio.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The _Py_Deepfreeze_Init() function calls _PyStaticCode_InternStrings once for each string.
Creating the interned string dict in one go, from the table of static strings would be much faster.
something like this (error checking omitted, and other liberties taken for brevity)
_Py_CreateInternedDict(PyObject **strs, int n) {
PyDictKeys *table = make_dict_keys(n);
for (int i = 0; i < n; i++) {
table->entries[i].key = table->entries[i].value = strs[i];
table->entries[i].hashcode = strs[i].hash_code;
// Fix up size and entries here.
}
return new_dict(table);
}
All the hash codes will need to be initialized first, but we probably should do that anyway.
- Lingua principale
- Python
- Stelle
- 77.2k
- Fork
- 36k
- Merge medio
- 1g 9h
- PR unite (30g)
- 558
Guida per i contributori
Apri la guida per i contributori
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.
Altre issue di python/cpython
-
docs pending
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
stdlib type-feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
stdlib type-feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
build type-bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
stdlib topic-email type-feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Tutte le issue di python/cpython
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
-
🐛 Bug 🔔 Pending processing
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
jumpserver/jumpserver#17584 ·