Tools to measure the effect of individual CSS rules on page rendering speed? [closed]

情到浓时终转凉″ 提交于 2019-12-06 09:31:30

There are a number of tools available to test the actual performance implications of loading and applying CSS. That said, with the things you specifically mentioned, they are particularly difficult to test.

Experienced CSS developers will have come across studies showing that rounded corers and CSS3 box-shadows can cause 'performance issues', but in this context they are more specifically talking about page responsiveness or how quickly the page responds to user actions.

Let me explain that in more detail. When talking about how fast a page renders or how long it takes for CSS and image assets to download and be available to the client, there are clear metrics that many different tools can provide. HTTP request and response times are measurable, as is the time from initial request to DOM ready. The problem is that all of these easily measurable things have already happened when you start looking at page responsiveness. Those issues will be related to your specific applications features, functionality and styling and can only be tested in an application specific way.

As an example, there are studies that have shown that in certain contexts, CSS3 box-shadows can cause non-smooth scrolling on a page or some lag time between user action and event completion. The easiest way to test this would be to manually test the page with and without the box-shadow so that you can visually see the difference. Now, if you know that box-shadow is known to cause certain issues, this might be something you would think to test, but for the people that have published their studies and findings on that particular issue, this is almost certainly not what they looked at first. It was something they discovered through trial and error.

In the end, the real answer is experience: having worked through issues and adding to your own collective knowledge. Reading blogs and other resources that discuss these issues can help with that.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!