dsherret / dsherret/ts-morph

JavaScript heap out of memory when using findReferences() on many identifiers

Open
#642 1 comment 0 reactions 0 assignees View on GitHub
performance
Dominant language
TypeScript
Stars
6.2k
Forks
238
Avg merge
2m
Merged PRs (30d)
1

Description

Hi,
So i've tried transforming the entire lodash-es library using `ts-morph`

After around 50 modules (there are ~900 there) JavaScript runs out of memory, not to mention that it's very very slow on my speedy Mac, (what would happen on a slower machine on a some CI in docker - I can only imagine)

Do you have any plans on optimising it, or any tips on making it faster? I must find another solution to it, cuz it's not acceptable even for production builds where speed doesn't matter, but I didn't expect it to be THAT slow)

UPD.
the slowest operations, that makes it literally 50x slower is `findReferences`....
UPD:
Found the culprit: I was doing findReferences on every single Identifier instead of selected items. That just killed it. I still have big hopes for this library xD

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.