How to improve request time to a WCF Service from Silverlight?
I have a Silverlight project in a solution of Silverlight Application. I also have a WCF service hosted in the same solution which exposes some method to the Silverlight app.
When I make a call to the service method from Silverlight it takes 4 seconds to reach the service method.
Why is it so, and how can I improve this?
I have logged time in an object list. I add DateTime.Now
object to collec开发者_Go百科tion at each step, then I calculate reach time of each step. And I am making the call through Service proxy.
Are all of your webservices call taking 4 seconds? The first one can be longer because the application is starting, but afterwards, the latency should be limited by the logic of your webservice.
Could you use fiddler, firebug or IE Dev tools to better monitor your service calls?
Basically if you are debugging (which you say you are) there is a massive overhead as DLLs are loaded for the service to run. Open your output window and see how busy your Dev Studio is while starting up the service!
The debug environment is not a good indicator of actual performance.
Refresh your Silverlight app page after running the service once. This will mean Dev studio already has the service DLLs loaded.
Try running your app installed under local IIS to get a better idea of how it will perform, however the only way you will see the real speed issues is to run it from your live site and test the speed there.
精彩评论