<div dir="ltr">Alan, is this fast result because you launched save with WebService AFTER normal save ?<div>Maybe the first one puts something in cache?</div><div>It would be interesting to launch normal save again to see if it is faster than before...</div><div class="gmail_extra"><div><div class="gmail_signature"><div dir="ltr"><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)"><div><br></div><div>Regards,</div><div><br></div><div><div><font color="#666666">Jonathan SARDO</font></div><div></div><div style="color:rgb(136,136,136)"><img src="cid:ii_13df029e6cb01b67" alt="Images intégrées 5"><br></div><div style="color:rgb(136,136,136)"><span style="color:rgb(0,0,0);font-family:arial;font-size:small">Tél. <a value="+33699455047" style="color:rgb(17,85,204)">06 99 45 50 47</a></span></div></div></div></div></div></div>
<br><div class="gmail_quote">2014-12-04 10:35 GMT+01:00 Alan Bell <span dir="ltr"><<a href="mailto:alan.bell@libertus.co.uk" target="_blank">alan.bell@libertus.co.uk</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I was curious because web services must call the regular save operation, so should be an overhead, not an optimisation . . .<br>
<br>
this is the code in include/webservices/<u></u>VtigerCRMObject.php in the Create function<br>
<br>
$adb->startTransaction();<br>
$this->instance->Save($this-><u></u>getTabName());<br>
$error = $adb->hasFailedTransaction();<br>
$adb->completeTransaction();<br>
return !$error;<br>
<br>
So it does call the normal save operation. I think that wrapping the save in a transaction means it does the updates to all the entity tables in one hit and reduces the database locks a lot.<br>
<br>
would be interesting to do some performance testing without the transaction in the webservices code, and adding a transaction wrapper around the save method in the non-webservice code.<br>
<br>
Alan.<div><div class="h5"><br>
<br>
On 04/12/14 09:24, Alan Lord wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 04/12/14 08:55, socialboostdk wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Almost unbelievably fast..?<br>
</blockquote>
<br>
Yes, I was amazed too. But both tests ran on the same server, using the same database and the same code apart from the save method itself...<br>
<br>
Al<br>
<br>
<br>
______________________________<u></u>_________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br>
</blockquote>
<br></div></div>
______________________________<u></u>_________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br>
</blockquote></div><br></div></div>