html - 现在电脑的性能都很好,有没有必要考虑CSS解析速度的优化?
高洛峰
高洛峰 2017-04-17 14:00:57
0
5
273

因为CSS的解析顺序是从右往左解析的,所以不使用标签选择器和不嵌套过多的层级,可以优化CSS的解析速度,但是有人说,现在电脑的性能都很好,没有必要去考虑这些。那么到底要不要考虑CSS的优化?

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(5)
伊谢尔伦

When doing technology, you should always consider optimization. This should be the consensus of every developer. Coding that is more concise and performs better has strong adaptability and higher scalability, and is also of great significance to improving one's coding ability.
Regarding the impact of the level of hierarchical nesting of CSS on performance, the performance of the CSS2 series version may not be reflected much, but in CSS3, through the operation of various animated elements and selectors, the load of the browser engine is compared css2 has increased in magnitude. The browser's rendering of web pages is single-threaded, so even if the configuration is higher, unexpected performance crashes may occur.

And the structure of the document has a huge impact on script writing~
To exaggerate, nested queries for DOM are like walls after walls.

左手右手慢动作

If there is no obvious parsing delay or performance bottleneck, why go to all the trouble...

黄舟

I decided it’s not necessary. Don’t over-optimize if there is no performance bottleneck.

Peter_Zhu

I don’t know what you think. Anyway, when I write CSS, I give priority to the effect and ease of maintenance, and I will talk about performance later. . .

伊谢尔伦

I agree with the above view: When doing technology, you must always consider optimization. This is not only responsible for the project and the code, but also an attitude towards oneself.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!