Monday, May 19, 2008

Integrating and optimising the Timeline component

I spent my Saturday integrating the Timeline component into the customer interface, and I've gotta say, it was looking pretty hot!



But when I looked at it again today with a fresh mind, I noticed its performance wasn't living up to its looks. It was taking a really long time for the data availability to load when you drag a product onto the timeline. So I added some tracking variables to my code which grabbed the current time at various points through its execution. By subtracting the times from each other I could see how long each part of the script was taking to run. Here's what I saw:



It was pretty obvious that something funny was going on in the section which processed the XML for the days on the timeline. When I knew where I was looking it was pretty easy to fix it and speed things up. Here's what I got after a few tweaks:



I reckon 8.8 times faster isn't bad!

No comments: