Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Opt-in API that has a cached `ThreadpoolController`

Aperta
#254 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@itamarst ci sta già lavorando.

Dal 23/9/2026.

  • #257 di @itamarst — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
performance

Direzione di ricerca

The proposal is a top-level get_cached_controller(force_new=False) API that caches a controller and rebuilds it when the number of loaded modules in sys.modules changes. Work is already under way in linked pull request #257, so read that PR and the three-comment thread before starting, to see what is still undecided. Done means the cache invalidates on new imports and force_new=True always rebuilds, and that behaviour is covered by tests.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Creating a controller is still expensive on Linux at least, so for libraries that do this a lot a cached version that notices when libraries change might be useful.

My thought is a top-level API get_cached_controller(force_new=False), that checks if e.g. the length of sys.modules has changed. If yes, it creates (and caches) a new controller, otherwise it returns a cached one. With force_new=True it always invalidates.

Application authors would presumably know that there's no other mechanism where new libraries might get loaded.

I would like to use this for joblib, on the theory that:

  1. Joblib never had this oversubscription mitigation before.
  2. This will catch the vast majority of cases where new libraries get added.
  3. In the rare cases it doesn't catch a loaded library, it's not a bug, it's just a performance hit... and again, joblib never solved this before anyway so those users are no worse off.
Lingua principale
Python
Stelle
434
Fork
38
Merge medio
2g 9h
PR unite (30g)
7

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di joblib/threadpoolctl

Tutte le issue di joblib/threadpoolctl

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.