-
-
Notifications
You must be signed in to change notification settings - Fork 344
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
feat(linter): eslint/no-loss-of-precision #649
Conversation
33dd887
to
bd4103a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This rule can be slow due to all the allocations, we may need to add a bunch of Cow
to reduce some allocations.
Some minor fixes are done, I will try my best to reduce the number of string allocations to improve the performance |
I am not familiar with |
@Devin-Yeung This rule is currently the slowest, twice as slow compared to all the others rules. Are you intrested in doing some performance work for this rule? |
It seems that the regex call is very expensive, maybe we can parse the number manually to get better performance. But unfortunately I haven't had much time to be able to deal with this lately😢. Should we consider opening an issue to invite anyone interested to collaborate on this? |
I'll create a first good issue when we have found a viable solution, otherwise it may waste people's time :-( |
Agreed, I'm also not sure how much of a performance gain manual parsing would bring about 🤔 |
Around 1.5-2x speedup of the rule on my machine on babel and typescript codebases, bringing it to times similar to the other slow rules. I'll clean up the code and send a PR. |
Close #613