문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top