Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

lists.asmx = Web Service
listdata.svc = REST API
client.svc = CSOM

Using JavaScript to query a list using the 3 available APIs, I'm finding lists.asmx responds much faster than listdata.svc or client.svc. For all three queries, I'm setting the ViewFields and/or $select properties to pull only 3 fields from the list which has about 400 items

I see this trend on my local SP2010 VM, and the SP2010 servers my company has deployed.

API            Size     Timeline
lists.asmx     46KB     131ms
listdata.svc   12.5KB   889ms
client.svc     40KB     326ms

What's going on? Why would these two new (to 2010) APIs be slower?

share|improve this question
2  
under what conditions? does order matter? did the second execution of any method return different results? benchmarking is tricky. –  Tom Resing Mar 15 '13 at 0:32
    
Very interesting data. I suppose we'd need to run similar queries in multiple environments against different sources to be sure, but the numbers feel right based on my experience. If you think about the transformations which must occur under the covers (none of which are "free"), it makes some sense. –  Marc D Anderson Jul 4 '13 at 19:13

2 Answers 2

Alway use filters for indexed columns first, like

Query = "<Where><Geq><FieldRef Name='ID' /><Value Type='Number'>1</Value></Geq</Where>"

that will increase perfomence. So query with indexed field ID faster then without

share|improve this answer

Try to limit your query: Use the ViewFieldsOnly flag. Be sure that it is set! You can use the CAML query builder to check your queries: http://www.codeproject.com/Articles/458008/CAML-Query-Builder

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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