View Single Post
  #5   Spotlight this post!  
Unread 15-11-2009, 13:50
Abrakadabra Abrakadabra is offline
Here We Go !!!
AKA: Scott Kukshtel, Mr. K
FRC #3467 (The Windham Windup!)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2002
Location: Windham, New Hampshire
Posts: 159
Abrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant future
Re: C++ vs. Java Performance

Quote:
Originally Posted by manderson5192 View Post
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.
Reply With Quote