IRequestChannel 请求速度慢
我正在从移动设备 Windows Mobile 6 调用一个简单的 helloworld Web 服务。我测量了所有内容,所有内容都很快,除了这个。
return requestChannel.Request(msg);
这很慢。我需要 300 - 380 毫秒!有谁知道为什么这么慢... XML 反序列化/序列化比这快得多..
I am calling a simple helloworld webservice from a mobile device windows mobile 6. I measured everything and everything is fast except this
return requestChannel.Request(msg);
This is slow.. I takes 300 - 380 ms!! Does anybody have an idea why this is so slow... XML desirialization/serialization is way faster than this..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
无论如何,我都不是 WCF 专家,但如果我没有记错的话,
Request
方法实际上是通过网络发送请求,对吧?通过网络发送和接收数据可能是计算机程序中最慢的事情(至少不要求用户输入)。在移动设备上,速度可能会更差。我敢打赌,您花费 99% 的时间等待请求/响应完成,而 1% 的时间实际处理响应。
如果无法改善客户所在城市的无线数据基础设施,为了防止这种情况,您唯一能做的就是减少对服务发出的请求数量。
I'm not a WCF expert by any means, but if I'm not mistaken the
Request
method actually sends a request over the network, right?Sending and receiving data over the network is about the slowest thing you can do in a computer program (short of asking the user for input, anyway). On a mobile device, speeds are likely to be even worse. I'd bet you're spending 99% of your time waiting for the request/response to complete and 1% of the time actually processing the response.
Short of improving the wireless data infrastructure in your client's city, the only thing you can really do to prevent this is to reduce the number of requests you make to services.