I created a WCF service; a simple getData(i). I hosted it in a windows service; wrote a client to access that service. getData(i) is "empty" - it just returns "you entered i".
Client
class Program
{
static void Main(string[] args)
{
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
ServiceReference1.iRateCacheClient client = new
ServiceReference1.iRateCacheClient();
string returnString;
for(int i = 0; i < 1000; i++)
returnString = client.GetData(i);
stopWatch.Stop();
}
}
In that client it takes
- ~ 2 seconds for 1 call to getData(i)
- ~ 2.4 seconds for 100 calls
- ~ 8 seconds for 1000 calls
Makes me think that the first call is taking too much time. My use case is that a lot of short lived client programs would be calling that service, once each. The whole purpose of writing that WCF service was that I wanted to separate out the function call from those clients to a separate process; i.e. I did not want to put that getData() inside of a dll that clients call.
2 seconds "overhead" for a service call is unacceptable. Am I doing something wrong? I expected that service call to be over in < 1 millisecond. I am accustomed to COM/DCOM; and the overhead for those was very minimal.
The local service is using HTTP transport.