有没有办法减少与进程外 COM 调用相关的开销?
我们的程序使用进程外 COM 服务器并对其接口进行数千次调用。这需要非常非常长的时间 - 例如大约 50k 次调用需要一分钟。 COM 组件供应商表示,调用本身非常快,问题在于与进程外调用相关的开销。
在这种情况下,有什么可以调整来减少开销吗?
Our program consumes an out-proc COM server and makes thousands of calls on its interfaces. This takes very very long time - like a minute for about 50k calls. The COM component vendor says that the calls are very fast by themselves and that the problem is in the overhead associated with out-proc calls.
Is there anything that can be tuned to reduce the overhead in such cases?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我真的认为如果没有供应商的帮助就没有什么可以做的。因为就其本质而言,进程外 com 对象比进程内对象需要更多的编组等。
如果您可以让供应商提供帮助,则有两种可能的选择。
节省您所谈论的流量的主要方法是 COM+,但这不能与进程外 COM 对象一起使用。
I really dont think there is much that can be done without help from the vendor. Since by its nature an out-of-process com object is going to require much more marshalling etc than an in-process one.
There are two possible options if you can get the the vendor to help.
The main thing for saving the kind of traffic you are tallking about is COM+ but this cant be used with an out-of-process COM object.
寻找一种方法来减少呼叫次数。
例如,如果接口允许,您可以考虑替换如下代码:
对于 c..d 中的 a {
数组[a]=obj.get(a)
}
与:
obj.getArray(数组)
Look for a way to reduce a number of calls.
For example, if interface allows, you might consider replacing code like:
for a in c..d {
array[a]=obj.get(a)
}
with:
obj.getArray(array)