-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
Skip ignore comment checks for files with no ignore comments #730
Skip ignore comment checks for files with no ignore comments #730
Conversation
Previously we'd cast every rule to a string and then check if an ignore comment is present. That constant casting and repeatedly calling the regex costs a lot of time. We can avoid that work if we know that the input source doesn't contain any ignore comments at all.
@marvinhagemeister Thank you this! @Antonio-Laguna Maybe we should reconsider removing this feature? Given that we are doing breaking changes for I've also looked over this feature and I don't see a way to make it not a performance issue. Thoughts? |
Dropping support for ignore comments all together works for me 👍 |
Another optimization is reusing saving the |
Because regex literals don't change during runtime (like I'd certainly rather see it behind a plugin for the few people who want it and are okay with the performance hit. |
see : #737 The check for the comment is impossible to make really fast. |
@marvinhagemeister Thank you again for starting this. We have merged #737 as a fix for the underlying issue and added you as a co-author because you did all the hard work to pinpoint the issue! We will ship this as soon as possible |
@romainmenke Awesome sounds good to me! Thanks again for taking a look 👍 |
@marvinhagemeister This was just released. |
Previously we'd cast every rule to a string and then check if an ignore comment is present. That constant casting and repeatedly calling the regex costs a lot of time. We can avoid that work if we know that the input source doesn't contain any ignore comments at all.
This speeds up postcss compilation time in one of my projects by about 4.6s. In that project there are no css files with postcss comments anywhere.
Before: