Quote:
Originally Posted by manderson5192
2) Interesting...On the USFIRST.org beta testing forums, team 67 posted this:
"the almost-empty loops we've timed run about 50 times faster in C++ than in Java. "
Is there really no noticeable performance hit?
...and a couple, related question:
4) How does the Java vision API compare to the C++ one? Is there a large speed difference?
...
|
I'm not a Beta tester, but I did talk with Brad Miller (father of WPILib) at RiverRage, and he spoke to two of your questions:
Re: Performance - Yes, C++, which compiles down to native machine code is always going to be faster than Java in pure speed tests, because Java has to take the extra step through the virtual machine. However, for our application, most (if not all) of the time-critical pieces are done in the FPGA libraries, where the JVM isn't a factor.
Re: Vision libraries - the vision processing code remains in C++, and is accessed in Java via wrappers that use the JNI (Java Native Interface), so again, there is no Java performance penalty involved.
HTH.