Skip to content

Fix no-descending-specificity performance#7026

Merged
romainmenke merged 3 commits intomainfrom
fix-no-descending-specificity-performance--considerate-avocet-12abeeb86a
Jul 3, 2023
Merged

Fix no-descending-specificity performance#7026
romainmenke merged 3 commits intomainfrom
fix-no-descending-specificity-performance--considerate-avocet-12abeeb86a

Conversation

@romainmenke
Copy link
Copy Markdown
Member

Which issue, if any, is this issue related to?

See #6869

Is there anything in the PR that needs further explanation?

This rule warned multiple times for the same selector.
It would emit one warning for each selector with lower specificity that preceded the current selector.

I don't think this is very useful as it just causes extra noise.

With this change this rule will only emit a single warning for each selector.
It will always reference the earliest other selector with lower specificity.

All these extra warnings came at a cost.
fewer warnings -> faster execution.

I've also added extra tests to cover this scenario.


before :

Warnings: 407860
Mean: 1452.8959879999998 ms
Deviation: 85.89908815057446 ms

after :

Warnings: 7117
Mean: 367.08543172727275 ms
Deviation: 14.07386884681592 ms

The excessive number of warnings is the result of the duplicate CSS in the test source.

Ideally we would have a large, but well formed and realistic benchmark source.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants