Dear friends, I am amazed with this estrange behaviour. Hope you
believe this is happening to me.
The case:
1. A simple Web Service with a single method returning a constant
quite big string (120KB), for performance test purposes (requires
authentication).
2. A simple client that calls 10 times this web service:
Sample Code:
mObjectWS = new TestMonitor.TestMonitorWS.TestWS();
mObjectWS.Credentials = new
System.Net.NetworkCredential(txtUser.Text, txtPassword.Text);
for(int i = 0; i < 10; i++)
{
string res = mObjectWS.DemoString();
}
Results:
If I run the client from the Visual Studio IDE (F5) it takes about 500
ms.
If I run the client outside the Visual Studio (double clik over the
.exe file or CTRL+F5) it takes about 5000 ms.
In both cases the job is done.
How can it be possible? Is Visual Studio skipping steps, or is the
.exe repeating unnecessary steps?
Thanks in advance,
Jerry
"Mohamed El Ashmawy" - 11 Dec 2004 06:35 GMT
Is the exe built in debug configuration? Building the exe using this
configuration would add debug suppost and would make the exe run slower.
If you do so, change the configuration to "Release" for the exe (and for
the web service too if it's built in debug mode) and re-test to see if the
performance is still slower than IDE
Regards
Mohamed El Ashmawy
MEA Developer Support Center
ITWorx on behalf of Microsoft EMEA GTSC
tolega@hotmail.com - 13 Dec 2004 08:57 GMT
Yes. Unfortunately it hasn't nothing to do with it.
The results are the same in both configurations, being IDE 10 times
faster than the standalone exe.
I have also noticed that it doesn't matter the size of data returned,
as the delay in EXE is constant per call.
I have also discovered a property of the web service proxy called
PreAuthenticate (defaults false). If your web service supports it (see
help) it will reduce the response times considerablily, setting it to
true.
Summary:
Release EXE: 5000 ms
Release EXE with PreAuthenticate=true: 2100 ms
Inside IDE: 500 ms !!!!!!!!!!!!!!!!
Inside IDE with PreAuthenticate= TRUE: 400 ms !!!!!!!!!!!!!!!!
Can anyone explain it?
Thanks,
Jerry