Performance
stephenway opened this issue · 3 comments
Not sure if this is related to just the nature of extends or how this plugin was designed, but I recently ran a speedtest with postcss-devtools on my compile and postcss-extend was reported at running 3.79 seconds. Maybe there is a way to speed this up? Thoughts?
Sadly it's part of how @extends
have to be handled, because it's capable of extending in an anti-pattern, it has to check the full CSS doc for the selectors it's extending. Implemented perfectly, for n-many @extends
to evaluate and x-many selectors: x * n things to process. It is not implemented perfectly, but I feel I got reasonably close with a recursive solution (still not pretty).
If it's becoming an issue, I can suggest utilizing @define-placeholder
more as it's stricter, can't be used out of pattern, and doesn't cause a recursive check for more extensions as you can't extend out of those rules.
@travco Thanks for the detailed response! I have been checking out how @define-placeholder
works and really like that solution. I might eventually switch to using that. Thanks