1

SpServices does offer the most user friendly piece of code on SharePoint, but if we enable async it still lags behind in performance when compared with the client model, any reasons?

Or am I missing something in my implementation ?

2
  • I would like to see what you mean by 'enabling async'. Can you post a code sample that you believe is slower than the CSOM? Also post the equivalent code in CSOM for comparison.
    – Paul T.
    Commented Feb 10, 2015 at 3:02
  • @PaulT. My Current block of code to query a list using SP Services $(document).ready(function () { $().SPServices({ operation: "GetListItems", async: false, listName: "Pictures", CAMLRowLimit: 6,....The other is a normal CSOM method to fetch the user data something like this. function retrieveListItems() { targetList = list.getByTitle("MyCustomList"); ... So on Commented Feb 10, 2015 at 9:38

2 Answers 2

1

SPServices uses the old SOAP service API, which although are deprecated, they continue to be a very fast API - especially for GetListItems...

In your follow up answer above, you show a snippet of code calling SPServices in synchronous mode (async: false) - meaning: your entire browser will "freeze" until the request is returned from the server and your callback is done doing its thing... This is not (in my mind) "enabling" async, but rather disabling it.

This is why I wanted to see 2 complete code samples... I doubt that CSOM is executed in synchronous mode... Actually: in client side development almost nothing should be done synchronous if you care about at all about UX.

My Advice is to NOT set the async parameter to SPServices or set it to true (the default)...

1
  • The main reason I disabled asyn in my site being too many async requests querying a whole lot of big data from all the lists. This was the only way I could get measurable performance SLA. Thanks a lot!!! Appreciate that! Commented Feb 23, 2015 at 12:10
0

I found the answer the SOAP API async requests though drastic , The throughput of individual request were way better than CSOM Object call.

The profiling confirmed the same. Thanks @Paul T

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.