-
Notifications
You must be signed in to change notification settings - Fork 39
Performance issues #44
Comments
Hey! Thanks for sharing your insights on this! While there maybe something that slows this rule or perhaps a more optimised way of achieving the same linting I wonder maybe you are running some other actions on save that take longer time (sometimes prettier is the one that is slow). Looking at this piece of config:
You are basically disabling all of the fixes and keep only eslint fixes which might point to something else being slow... Could you please confirm if this is still slow without that setting specified? |
I already did that kind of research 😉 VScode is showing a notification in the bottom-right that says Of course, I'm not saying everyone should be adding this config to their editor. It's entirely possible that it heavily depends on the volume and structure of a project, whether or not a performance hit (if any) from |
Awesome @thany, thanks for confirming this! I don't have any experience in debugging eslint rules unfortunately so not quite sure if this is actionable at this point so I might move this issue to discussions instead, unless, of course, if somebody else have an idea how to tackle this 🙂 |
That's fine. I'm not used to discussions being a thing yet, so I go to issues mainly out of habit. Your call 😀 |
On our fairly large codebase, node OOMs even after 10 gigs of memory. |
Problem with performance is also visible when running timing (TIMING=1 npm run lint):
|
Just a heads up - we've landed a small perf PR in v1.3.3 which may reduce some seconds from your times but don't get too excited as it was a really tiny fix 😁 |
Thanks! I'm no longer on the same dev team that used this plugin, but I'll consider using it with my new teammates 🙂 |
Ref typescript-eslint/typescript-eslint#2620 (comment) for some insights into performance. |
Jus to throw in my two cents, my results are pretty poor as well for this rule
|
Same observation from me, this plugin is 3 times slower than already slow
EvgenyOrekhov/eslint-config-hardcore#732 (comment) has some more insights into alternatives to this plugin, but none are particularily fast it appears. |
Does anyone have a link to an open source repository where this rule is really slow? I have some ideas for improvements that I'd like to try out, but don't have an open source repository to try them out on. |
Never mind. I ended up using For the record though, it looks like almost all of the time is spent in TypeScript's |
Yes, I assume the issue is mostly a upstream one because all deprecation checker plugins are kind of slow as per EvgenyOrekhov/eslint-config-hardcore#732 (comment). I guess a few % could be shaved off in the plugin as there is a visible difference to |
In a rather large project, that unfortunately I'm not at liberty to share, performance of this plugin is a bit dissappointing.
The result of this is not only that it might take a very long time to lint the entire project, but more importantly, in VScode with lint-fixing on save enabled, it will take several seconds for each save action to complete.
I understand it's difficult to get this problem fixed in this particular repository, however, there just might just be a workaround 😎
Inspired on this more generic issue and this preceeding issue, the solution appears to be this piece of VScode configuration:
Essentially skipping the
deprecation/deprecation
rule. This is fine, because the rule only checks code, but doesn't provide fixes, which is exactly the only thing linting on save is good for. The other bits of config are important to get the VScode extension to understand therules
setting in the first place.Now, I realise that this only fixes it for VScode (well, it does on my machine), so if you enjoy a different editor, you might have to seek out a different solution. However, the above configuration might nudge that search in the right direction. I would not be surprised if eslint plugins for other editors have a similar
rules
setting to filter certain rules.And perhaps it's a good idea to list those solutions below, when anyone finds one.
The text was updated successfully, but these errors were encountered: