Microsoft/TypeScript

Optimize constructing type nodes from types

Open

#34.776 aberto em 28 de out. de 2019

Ver no GitHub
 (0 comments) (2 reactions) (0 assignees)TypeScript (6.726 forks)batch import
BugDomain: PerformanceHelp Wanted

Métricas do repositório

Stars
 (48.455 stars)
Métricas de merge de PR
 (Mesclagem média 6d 17h) (9 fundiu PRs em 30d)

Description

Originally posted by @weswigham in https://github.com/microsoft/TypeScript/issues/34119#issuecomment-545640573

Yep, looking at the traces I see pretty much all the time spent in trySymbolTable and getAliasForSymbolInContainer, which are workers user for calculating visible symbol chains. The whole process is uncached and quite naive right now (it's pretty much the same as it was since TS 1.8, but we rely on it more and more). It has been on my backlog as something that needs to be rewritten with a better more cacheable structure for perf.

There's also a fair chunk of time spent in GC and in path component-related operations that might also need some optimization - I'm guessing the large number of import types we manufacture require a large number of path calculations which end up making a lot of garbage - some caching may be in order here.

Guia do colaborador