Looking for ideas to speed up Calendar Event processing

Oct 8, 2014 at 1:10 AM
Hi,
I have an application where I need to query 22 different Sharepoint 2013 calendars and aggregate the results into one html table. Everything is working fine (huge thanks to those who contributed to the code samples that untangle handling Sharepoint calendar recurring events!) except that the page takes about 14 seconds to complete, ie: from the time user clicks "Go" until the time the page has completed rendering in the browser.

Using the Chrome developer tools, I can see the 22 asynchronous calendar calls take on average 200mS each for the round trip, accounting for 22x200mS=4.4 seconds. So where did the other 10 seconds or so go? Again, looking at the Chrome developer tools, it seems the bulk of the remaining time is spent immediately after each calendar call round trip on these two lines:
completefunc: function (xData, Status) {
     $(xData.responseXML).SPFilterNode("z:row").each(function() {
I assume there is a lot of overhead taking the XML serialised data that comes back from Sharepoint and converting it into the xData object, and that that is where the extra processing time goes.
I just love the convenience of the SPServices libraries, but in this case I was wondering if there is any faster way of handling the XML data that comes back and extracting the attribute values?

I can confirm that I have already optimised my CAMLViewFields and CAMLQuery to only return the required fields and rows and nothing more.

Any ideas gladly received :-)

Jon
Oct 8, 2014 at 1:58 AM
Edited Oct 8, 2014 at 1:59 AM
Sorry false alarm everybody!

It turns out the delay was not in the code sited above, but with my code within the each(function() loop.

I was stupidly requerying a combobox inside the loop like this :
 $("#comboboxCollectionCentreTest").val().toUpperCase();
Once I moved this OUTSIDE the loop all my speed issues vanished!

Shade and Sweet Water
Marked as answer by jonfnz on 10/7/2014 at 6:58 PM
Coordinator
Oct 8, 2014 at 2:23 AM
Good lesson learned here!

M.
Oct 8, 2014 at 2:43 AM
Edited Oct 8, 2014 at 2:44 AM
Yes, good lesson indeed!

Never in a million years would I have thought a jquery operation like $("#comboboxCollectionCentreTest").val().toUpperCase(); would be so incredibly expensive!

PS: Great work on the SPServices library Marc!! I've been a fan and user for many months :-)