Java COM bridge

谁说胖子不能爱 提交于 2019-12-23 17:36:06

问题


I have an ultra-low latency program and need to interface with a Windows COM component. What would be the fastest way to do this? Using a COM bridge like JACOB or write a native COM library and send out messages using a messaging bus like ZeroMQ?


回答1:


If you use ZeroMQ, you'll be dealing with two processes. And passing a message from one process to another is more expensive than doing the same within the same process. So using a Java COM bridge will certainly result in a lower latency.

Having said that, it's however only relevant if you're dealing with extermely low latency. If your COM component already has a latency several times higher than inter process message passing (e.g. because it is receiving and forwarding messages over a network or performing expensive computations), then either option will be okay because they both have a marginal effect on the overall latency.

Note that JACOB doesn't support all COM components, only those with a COM automation interface. So you might need to use a different Java COM bridge such as JCom.



来源:https://stackoverflow.com/questions/7298056/java-com-bridge

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!