Tracking issue: compile cache
Nessuno ha ancora preso questa issue.
- Lingua principale
- JavaScript
- Stelle
- 122k
- Fork
- 37.3k
- Merge medio
- 4g 2h
- PR unite (30g)
- 283
Descrizione
Follow up to https://github.com/nodejs/node/issues/47472 . Some items that can be investigated:
- Initial implementation, enabled via
NODE_COMPILE_CACHEenvironment variable: https://github.com/nodejs/node/pull/52535 - Exposing an API for user code to control the caching https://github.com/nodejs/node/pull/54501
- An API for flushing the cache: https://github.com/nodejs/node/pull/54971
- Support relative/portable cache: https://github.com/nodejs/node/pull/58797
- Embedder API for configuring the storage
- Support reading a list of files to generate cache ahead of time: https://github.com/nodejs/node/issues/58482
- Idle-time cache serialization like what Blink does, to avoid penalizing the first load
- Other hashing algorithm (CRC32 may be good enough for our use case. In the initial implementation, it was chosen because it can be used on no-crypto builds and fast enough. For reference, ccache has used md4 and later BLAKE2b -> BLAKE3)
- Other directory layout (splitting the cache for each file and read on the fly seems to be fast enough and I don't really see I/O showing up in the profile anyway) or using a db (if/when we implement Web Storage?)
- Inode caching like https://github.com/ccache/ccache/pull/577 (note that CRC32 also barely shows up in the profile, it may not worth the complexity).
- Avoid UTF8 transcoding by directly reading the source code as buffer from disk (this needs to dance with CJS loader monkey patching)
- Move the flushing operations off-thread so that they can be done as soon as the code cache is ready and can be done concurrently https://github.com/joyeecheung/node/tree/parallel-compile-cache (this likely tanks the performance for simpler use cases)
- Implement TS -> JS caching https://github.com/nodejs/node/issues/54741
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.
Direzione di ricerca
Inizia con la follow-up issue collegata 47472 e gli elementi compile-cache non selezionati in questa tracking issue. Scegli un’indagine specifica, ad esempio l’embedder API o la generazione della cache ahead-of-time, quindi identifica gli entry point e i test Node.js pertinenti prima di definire il completamento di quell’elemento. Attualmente l’issue non fornisce alcun percorso di file o test, quindi è necessario definire prima l’ambito.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, node.js, typescript
- Ambito
- performance, tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Attiva
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 35/100