开发者

Can a Javascript error slow the website's load time

I have a web portal cricandcric.com which 开发者_运维知识库I have done using the php, java script, and mysql.

I dont see the java script error in Firefox, but i see the error in IE, I observe the site loads faster in Firefox than in IE.

So my question, does java script errors can slow down the website loading time, even though the java script placed at the end of the page, (Yslow Strategies)


It depends. If the error happens early on and a lot of your script code is bypassed, it could actually make it faster. But every time an error occurs, there is some overhead (the exception object has to be built and sent up the call stack to look for any catches), so if it happens at the end, the script would run slower.

But I doubt your change in load time is noticeably impacted by script errors. How long the script takes to execute on the browser's JS engine or a host of other factors will have more impact.


IE's javascript engine has always been notably behind the other common browsers in performance, so it really might come down to that more than anything else. One of the many improvements in IE9 is JS execution speed that's actually competitive.

That said, the JS error probably is worth looking into, since it's occurring every time the image slideshow advances which happens once every couple of seconds.

If you're concerned about performance in general, there are a couple of tools like YSlow and the recently-opensourced DOM Monster bookmarklet, for giving suggestions on general ways to speed up websites. You might also want to check out some of the writings of Steve Souders.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜