Tracking issue: compile cache
Abierto
Nadie ha tomado este issue todavía.
esm
module
never-stale
- Lenguaje dominante
- JavaScript
- Estrellas
- 122k
- Forks
- 37.3k
- Merge medio
- 4 d 2 h
- PR fusionados (30 d)
- 283
Descripción
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
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con el issue de seguimiento enlazado 47472 y los elementos de compile-cache sin marcar en este tracking issue. Elige una investigación específica, como la embedder API o la generación de caché ahead-of-time, y después identifica los puntos de entrada y las pruebas relevantes de Node.js antes de definir cuándo se considera completado ese elemento. Actualmente, el issue no proporciona ninguna ruta de archivo o de prueba, por lo que primero debe establecerse el alcance.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript, node.js, typescript
- Área
- performance, tooling
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Activo
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 35/100