views:

227

answers:

4

I have a page that uses jQuery UI, and calls the datepicker on 2 different text boxes. Without the calls, ie. just loading the page without attaching any datepickers, the page loads in 1.20 seconds. With the datepickers attached, the page loads in 3.92 seconds. (this is in firefox)

How can I get this speed up? Based on the network graph in Firebug, it isn't a network problem, but it seems to line in the datepicker attachments. Is there a way to speed this up?

Also, the behavior is only seen in Firefox 3.0.11. Chrome is quick and zippy, and so is IE7.

A: 

I suggest taking a look at this link: http://net.tutsplus.com/articles/web-roundups/20-tools-to-make-the-life-of-a-web-developer-easier/. In there you will find a link to http://tools.pingdom.com/ which will help you to determine page load issues. Try the two versions of your page and see what this tool uncovers for you.

Andrew Siemer
+3  A: 

Try running Firebug's code profiler to see which functions are bogging things down. Basically, hit the "Profile" button, refresh the page, let it load up, then hit the "Profile" button again to get a read out of what's consuming the most resources or taking the longest time.

The profiler should give you an idea of what's chugging along: whether it's in your code or something in jQuery UI.

In a more general sense, make sure you're using efficient selectors to choose the Elements your binding your date pickers to. Also, is it possible that the date pickers are injecting something into the DOM (stylesheet, images, etc.) that are bottlenecking (been a while since I used jQuery UI's date picker, so that might not be an issue)?

ajm
A: 

Use the FireBug and YSlow plugins for FireFox. The former allows executing timing and logging, and the latter has a list of rules and makes suggestions as to what to tune.

lavinio
YSlow doesn't profile the code execution, only the stuff being loaded. The load isn't the problem, it is something that the datepicker attachment is doing, because the slowdown is only there after DOMLoad.
cdeszaq
+1  A: 

dfa had it correct in the comments to my main post. The problem was Firebug. I guess it just didn't play nicely with the datepicker loading. Once firebug got turned off, page load times were around .5 seconds, right where they should be.

cdeszaq