And*_*vey 5 javascript performance internet-explorer-8
我正在使用IE9,使用F12工具进入IE8标准模式,来测试我的页面.页面脚本用于getBoundingClientRect计算视口中可见的内容.
使用分析工具,我看到要getBoundingClientRect花费大量时间的电话.例如,对函数的244次调用占用了4,361ms的独占时间!
这个功能在IE8中有这么慢的原因吗?在IE9模式,Chrome,FireFox等运行时,功能似乎很快.
getBoundingClientRect是Microsoft 在 IE5 中首次引入的,并且没有已知的性能问题。
jQuery UI 和其他人使用它,当他们过去转向它时,非常棒:http ://ejohn.org/blog/getboundingclientrect-is-awesome/
jQuery similar calculation我发现了和之间的比较getBoundingClientRect:
http: //jsperf.com/getboundingclientrect-vs-jquery
通常会赢得 getBoundingClientRect
您正在以 IE8 兼容模式运行您的网站,有时会影响性能,您可以在真正的 IE8 浏览器中测试它吗?这里的性能必须是相同的。