简体   繁体   English

删除过度资格的元素是否真的能提高性能?

[英]Does removing overqualified elements really improve performance?

I used some tools to validate my css for improving performance and i got feedback asking me to remove overqualified elements. 我使用了一些工具来验证我的css以提高性能,我得到反馈,要求我删除过度合格的元素。

It does makes sense as it can improve selector performance, but was surprised to see this one as overqualified: 它确实有意义,因为它可以提高选择器的性能,但很惊讶地看到这个被认定为过于合格:

"div#container is overqualified, just use #container" “div#container超标,只需使用#container”

Does this really matter? 这真的很重要吗? I have lot of such occurrences in my css and was skeptical if this can do any good for improving performance. 我的css中有很多这样的事件,并且如果这对提高性能有任何好处则持怀疑态度。

There are multiple performance metrics to consider, but at the very least it improves the network bandwidth and speed performance by sending 3 less characters across the wire. 需要考虑多个性能指标,但至少可以通过在线路上发送3个字符来提高网络带宽和速度性能。 admittedly pretty negligible, but could add up if standard across all selectors. 诚然,这几乎可以忽略不计,但如果所有选择者都是标准的,可以加起来。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM