function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
salesforce intesalesforce inte 

Time required in seconds to insert a singlle opportunity

Hi,
 
We would like to know the standard time required to insert a single opportunity using apex api from c# web application.Is this time in seconds or miliseconds.
Currently from our application it takes 3-4 seconds to insert a single opportunity and get the result back.
 
Amit Lohogaonkar
DevAngelDevAngel
Hi salesforce inte,

The time to insert a record in force.com is milliseconds.  Included in that span is the time to send the request and recieve the response.

I would take a look at any setup and tear down that may be happing on the stub (initialization, login, etc) and make sure that you are taking advantage of compression.



salesforce intesalesforce inte
Hi,
Currently we are using free developer login account to send data to salesforce for our initial testing purpose.
We are using c# asp.net to login into salesforce developer account.
It takes 3-4 seconds to login into salesforce and getback loginresult.
Is this time correct or should it be very less.
Let me know as its taking too much time for each transaction.
 
Amit Lohogaonkar
amit@varstreet.com
DevAngelDevAngel
The login takes a bit more time than some of the CRUD calls.  You should avoid logging in for each interaction through the API if possible.

One way to do this is to wrap the sforceService class and make it static.  Create a property to retrun the "binding".  In the property check to see if it is logged in and if not, then do a login before returning the binding, otherwise just return the logged in binding.

It's also a good idea to account for session timeout in that wrapper.  Record the time of the login and calculate when the session will expire.  Use that calculated value in your binding property getter function so that in addition to checking for login, you can check to see if the login may be close to or has passed the expiration time.  If it has, then call the login function again to refresh the session before returning the binding.

Cheers.
SuperfellSuperfell
One thing to look out for is that in .NET 1.1, the XML serializer/deserializers are code-gen'd and compiled at runtime, on the first invocation of the stub. This can soak up a fair amount of time, and if your ASP.NET worker process is getting recycyled a lot, then you can end up paying this cost a lot.

.NET 2.0 allows you to pre-compile this stuff at build time instead.

Other interesting causes i've seen with slow round trip times is if your primary DNS server is down, in which case when the code trys to resolve www.salesforce.com / nax.salesforce.com to an IP address, it has to wait while it decided to give up on the primary and try the secondary.

Then there's basic networking stuff, are you using compression, how much bandwidth do you have etc.
salesforce intesalesforce inte

Thanks DevAngel, Simon for a valuable response.

We will look into all things you mentioned to check if it causes some time delay.

Regards

Amit Lohogaonkar

amit@varstreet.com