This forum has been archived. Please start a new discussion on GitHub.

Java/C#/C++ latency comparison

Hi all,

I read on these forums that when using ICE with java it has roughly double the latency when compared to using ICE with c++. Is this true and why would this be? Also how would the latency of ICE with c# compare to them? I'm currently developing my application using c# but if it's latency is problematic then I may switch to another language binding. Knowing which language would produce an "acceptable" latency may make me lean towards it. Thanks in advance.




  • marc
    marc Florida
    Yes, Ice for Java has roughly double the latency of Ice for C++. The reason is that Java does not allow for certain optimizations that can be done in C++. In particular, Java does not have stack-based objects, and Java does not give the application control over memory management. I have not measured Ice for C# recently, but since C# is very similar to Java, I would expect the performance of Ice for C# to be similar to Ice for Java.

    You can easily run a performance test yourself, by running demo/Ice/latency and demo/Ice/throughput with C#, Java, and C++ on the same machine, so that the results are comparable. Make sure to use compiler optimization for C++, the debug version is much slower than the optimized version.
  • Thanks for your advise Marc.


  • marc wrote:
    In particular, Java does not have stack-based objects...

    What about using Javolution ?
    It's a real time library, but I've read in the feature list that permits the allocation/recycling of objects in the stack. Maybe this can reduce the latency and memory issues?

    Only my 2cents :)