Web服务与类文件 - 性能 [英] Web service vs. class file - performance
问题描述
对此有任何帮助或意见。
如果您调用作为Web服务,您仍然必须通过代理和参数编组,即使您在同一服务器内调用;相比直接调用相同的类有一个性能命中;呼叫开销可以高几个数量级。如果被调用方法没有做大量工作,你不会这样做。
I am trying to figure out the best way to go about doing this: I am working on a project and I'm putting all my data access layer code into .ASMX files to keep them separated from my presentation layer. I am calling all my methods from the code behind and using the web services like class files. I am following this practice based on one other developer's work. Two opinions on this so far: One says when the code-behind calls the method from the web service, it's a performance hit because it has to go do an HTTP request and the other says, no performance hit. The ASMX files are within the same project on the same server. Is there indeed a performance hit or not really? I tend to think not.
Any help or opinion on this would be appreciated.
If you call as a web service, you still have to go through the proxy and argument marshalling even if you are calling within the same server; there is a performance hit compared to calling the same class directly; the call overhead may be orders of magnitude higher. You wouldn't want to do this if the called method isn't doing some substantial work.
这篇关于Web服务与类文件 - 性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!