How to test CSS selector performance?

后端 未结 4 617
生来不讨喜
生来不讨喜 2020-12-30 23:30

How would I go about testing the performance benchmarks of different css selectors? I\'ve read articles like this. But I don\'t know if it is applicable to my website becaus

4条回答
  •  北荒
    北荒 (楼主)
    2020-12-31 00:09

    Check out the Page Speed extension for Firefox. Once you run it for a page, under "Use efficient CSS selectors" it gives you a list of the offending CSS selectors along with brief explanations.

    Also, there's another extension for Chrome - Speed Tracer. Amongst other things, it offers insight into time spent on CSS style recalculation and selector matching. This may just be what you are looking for.

提交回复
热议问题