Skip to content

Conversation

jayu
Copy link

@jayu jayu commented Sep 23, 2025

Hi, we've been using this great tool for a long time, but recently we observed it takes a lot of time to run the plugin.

The plugin was running on our codebase for 20s.

After whole afternoon spend on rewriting the project to regular expresions to replace ts compiler and AST lookup I've found out that what is acutally slow is replacement of the types in the declaration file 🤡

Turns out slice / substring toghether with concatenation and allocating new string in each iteration is very slow on long strings as it has to copy all characters multiple times.
ChatGTP suggested the solution, and as a result it now takes just 1s to run the plugin 🥳

My poc with regexps was even faster, I mean extraction was faster and it overall took 500ms, but traversing AST is defenitely easier to maintain, so I gave up on that.

Btw tests on main are failing, I'm not sure how to proceed.

before

image

after

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant