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

Optimize Map.prototype.getOrInsertComputed

Aperta
#1,157 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
c, javascript

Direzione di ricerca

Start with Map.prototype.getOrInsertComputed and JSMapState, then trace how map mutations are handled while the user-provided function runs. Assess whether a change counter avoids the second search without making set and delete operations too costly; done means the optimization's net benefit is established while preserving behavior when the function changes the map.

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

Descrizione

It currently searches the map twice (both before and after calling the user-provided JS function) because the user's function can change the map.

That's uncommon though, and can be avoided by adding a change counter to JSMapState. If the counter didn't change, the user's function didn't change the map, and we don't have to search again.

It means the set and delete operations have to do more work though, so I'm not fully convinced it's a net win. I'm opening this as a reminder to myself so I don't forget.

Lingua principale
C
Stelle
3.9k
Fork
389
Merge medio
4g 1h
PR unite (30g)
24

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 quickjs-ng/quickjs

Tutte le issue di quickjs-ng/quickjs

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.