Generating Compile Cache Ahead of Runtime
Nessuno ha ancora preso questa issue.
- Lingua principale
- JavaScript
- Stelle
- 122k
- Fork
- 37.3k
- Merge medio
- 4g 2h
- PR unite (30g)
- 283
Descrizione
What is the problem this feature will solve?
It is currently not possible to generate the compile cache without executing the files that will be cached.
Currently, container images and lambda functions can't easily generate code caches ahead of the actual runtime, since the code may have effects you may not want to execute early.
What is the feature you are proposing to solve the problem?
Would it be possible to add a way to generate the compile cache without executing the relevant files, i.e. walking the module tree from the entry point, generating caches along the way?
Perhaps something like node --generate-compile-cache path/to/entrypoint.mjs
and/or
module.generateCompileCache("path/to/entrypoint.mjs")
What alternatives have you considered?
You may be able to work around this by adding "dry-run" code paths specifically for code cache generation, but this is a hacky workaround that can require massive effort.
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 esaminando il comportamento esistente della cache di compilazione di Node.js e gli entry point proposti --generate-compile-cache e module.generateCompileCache(). Determina come sia possibile attraversare l’albero dei moduli di un entry point senza eseguire il codice dell’applicazione. Il lavoro è completo quando esiste un modo documentato e testato per generare la cache di compilazione pertinente prima dell’esecuzione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, node.js
- Ambito
- backend
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Attiva
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 38/100