microsoft / microsoft/TypeScript
Idea: Can we cache the result of `typeToTypeNode`?
Abierto
@weswigham ya está trabajando en esto.
Desde el 3/11/2021.
Domain: Performance
Rescheduled
- Lenguaje dominante
- Go
- Estrellas
- 111k
- Forks
- 14.3k
- Merge medio
- 2 d 4 h
- PR fusionados (30 d)
- 132
Descripción
A large percentage of declaration emit time (and a small percentage of check time) is spent in typeToTypeNode and tracing indicates that it is called on some types many times (hundreds or thousands in a sufficiently large project). I suspect, but have been able to demonstrate, that those requiring a import() qualification are particularly expensive. Could we cache the result? Two clear obstacles:
- Nodes are mutated during emit, so we'd need to clone anything retrieved from the cache. I'm reasonably confident that cloning will be cheaper than recomputing.
typeToTypeNodetakes a complex context argument. Possible workarounds include including the context hash in the cache key and storing the cached value on the context.
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.
Evaluación
Este issue todavía no se ha evaluado.