I just finished with my adapted version of the ZmCsfeAsynchCommand and after running a couple of tests I came to the conclussion that asynch communication is a lot faster then the synch communication.

Here are the test results.

synch roundtrip: 1400 - 1600 ms
asynch roundtrip: 203 - 1000 ms

So asynch can be about 7 times faster then synch. It fluxtuates for some reason.

My tests aren't designed for benchmarking, but besides that, it looks a lot faster. In near future I will do some serious benchmarking because I find this really important to now before I create a real application with ajax and zimbraTK.

Here you see the debug messages returned from the roundtrip. I used the same soap command and the same data with both versions.

Code:

Code:
 REQUEST

 ------------------------------------------------------------------------

 <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<FindPersonById xmlns:n1="urn:ActionWebService">
<id>
1
</id>
</FindPersonById>
</soap:Body>
</soap:Envelope>

------------------------------------------------------------------------

 REQ. HEADER: Content-Type - text/xml; charset=UTF-8

 REQ. HEADER: SOAPReturnFormat - JSON

 REQ. HEADER: SOAPAction - /client/api/FindPersonById

 ROUND TRIP TIME: 1437



 RESPONSE

------------------------------------------------------------------------

 Body: {
  birthdate: "1982-04-22",
  email: "info@smies.com",
  firstname: "Maurice",
  group_id: 5,
  id: 1,
  lastname: "Zeijen"
 }

------------------------------------------------------------------------

 ASYNCHRONOUS REQUEST

------------------------------------------------------------------------

 <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<FindPersonById xmlns:n1="urn:ActionWebService">
<id>
1
</id>
</FindPersonById>
</soap:Body>
</soap:Envelope>

------------------------------------------------------------------------

 Found free Rpc Context in cache

 Have callback

 REQ. HEADER: Content-Type - text/xml; charset=UTF-8

 REQ. HEADER: SOAPReturnFormat - JSON

 REQ. HEADER: SOAPAction - /client/api/FindPersonById

 ReadyState changed

 ready state = 1

 ReadyState changed

 ready state = 2

 ReadyState changed

 ready state = 3

 ReadyState changed

 ready state = 4

 status = 200


 ASYNCHRONOUS REQUEST RETURNED

 ASYNCHRONOUS ROUND TRIP TIME: 203

 RESPONSE

------------------------------------------------------------------------

 Body: {
  birthdate: "1982-04-22",
  email: "info@smies.com",
  firstname: "Maurice",
  group_id: 5,
  id: 1,
  lastname: "Zeijen"
 }

------------------------------------------------------------------------