-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prettier much slower when using this plugin #114
Comments
Hey thanks for reporting! Might be a performance regression (already had two of those iirc, might be time for some performance tests 🙈).
This function from If neither you nor someone else would be able to drill down on this, it'll probably take me some time to get to this, maybe next week. |
Hm ok by just looking at the code a bit, i think I might have figured it out already. update 7/2/24: looked into this again, and the memoization is done twice, once for |
@simonhaenisch Is not it better to find all tsconfig paths and just use search inside of the array and use most similar path. How much performace cost has |
I just tested this myself and didn't notice any significant difference with the plugin enabled/disabled. |
@DaniloNovakovic just looking through the issues again and found this. I still haven't had these kinds of performance issues, but just wondering is there a sample file you could share where you have the issue? |
@simonhaenisch We're seeing a dramatic slow-down (10x) since upgrading to v4. Here are some stats: Before upgrading (v3.2.4)
After upgrading (v4.1.0)
With organize imports plugin disabled
|
@tmannherz thanks for sharing, that repo doesn't happen to be open-source, does it? problem is that at the moment i don't have anything to reproduce this with, or at least the impact is much less significant. (I can still try to figure out which functions are slow) |
It's not, but if I can reproduce outside of our repo, I'll post back here with more info. |
Would you be able to share one slow file maybe, e.g. the |
|
Hm tried reproducing with that file, and it's about 25 ms without and 40 ms with the plugin, with either version 3 or 4 🤷🏻♂️ nothing like the 1 second your seeing. |
Hi guys, I really like this plugin, however what I have noticed that it slows down prettier by quite a lot.
For example, here is with this plugin:
and without this plugin (when I remove it from
plugins
inprettierrc
)As you can see it essentially adds extra 100ms for each file, which has huge impact since we have big monorepo on our project, so this performance issue is very noticable.
Note: I also tried adding
"organizeImportsSkipDestructiveCodeActions": true,
but it didn't have any impact on performance.Additional info:
"prettier": "^3.0.3",
"prettier-plugin-organize-imports": "^3.2.3",
OS: Windows 10
Files are written in typescript + react + emotion.
The text was updated successfully, but these errors were encountered: