Repository navigation
Closed
Labels
Needs InvestigationThis issue needs a team member to investigate its status.
Description
Acknowledgement
- I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion.
Comment
Reproduction:
-
Clone the kibana repo
cd /tmp git clone --depth https://github.com/elastic/kibana cd kibana yarn yarn kbn bootstrap code .
-
Generate typecheck tsconfigs:
node scripts/type_check.js
Don't wait for the script to finish.
Once you seeinfo starting [tsc] > node_modules/typescript-7/bin/tsc -b tsconfig.refs.json --builders 6 --checkers 3 --prettyin output, you canctrl-cit. -
Put
"js/ts.customConfigFileName": "tsconfig.type_check.json",into.vscode/settings.json -
Locate
category?: AppCategoryand request Find All References oncategory -
Run
Developer: TypeScript: Save Heap Profile -
Open
alloc_spaceflamegraph
For projects like Kibana with a lot of compilerOptions.paths, allocating ParsedPatterns for every module resolution consumes too much memory.
TypeScript/tsc/internal/module/resolver.go
Lines 2011 to 2044 in 8ac035a
| func TryParsePatterns(pathMappings *collections.OrderedMap[string, []string]) *ParsedPatterns { | |
| paths := pathMappings.Keys() | |
| numPatterns := 0 | |
| for path := range paths { | |
| if pattern := core.TryParsePattern(path); pattern.IsValid() && pattern.StarIndex == -1 { | |
| numPatterns++ | |
| } | |
| } | |
| numMatchables := pathMappings.Size() - numPatterns | |
| var patterns []core.Pattern | |
| var matchableStringSet collections.Set[string] | |
| if numPatterns != 0 { | |
| patterns = make([]core.Pattern, 0, numPatterns) | |
| } | |
| if numMatchables != 0 { | |
| matchableStringSet = *collections.NewSetWithSizeHint[string](numMatchables) | |
| } | |
| for path := range paths { | |
| if pattern := core.TryParsePattern(path); pattern.IsValid() { | |
| if pattern.StarIndex == -1 { | |
| matchableStringSet.Add(path) | |
| } else { | |
| patterns = append(patterns, pattern) | |
| } | |
| } | |
| } | |
| return &ParsedPatterns{ | |
| matchableStringSet: matchableStringSet, | |
| patterns: patterns, | |
| } | |
| } |
Metadata
Metadata
Assignees
Labels
Needs InvestigationThis issue needs a team member to investigate its status.
Activity