|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#16
|
||||
|
||||
|
Re: Java versus C++
Quote:
Can you please provide an authoritative reference, or experimental data, to support the claims that: 1) properly-written code using pointers in C++ runs slower than functionally equivalent code written in Java and 2) properly-written code using malloc in C++ runs slower than functionally equivalent code written in Java Thanks! |
|
#17
|
|||
|
|||
|
Re: Java versus C++
My understanding is that the JVM that's been ported to the cRIO is the squawk VM, which is not a real-time VM. While you might have your own opinions about the importance of a system being real-time or not, that was something that played into our thought process.
|
|
#18
|
||||
|
||||
|
Re: Java versus C++
Quote:
It was my understanding (perhaps incorrect) that the 2010 FRC Framework for Java was written in such a way to use the underlying vxWorks RTOS to handle the realtime aspects, thus mitigating the lack of true built-in realtime support in the VM. Not? |
|
#19
|
|||||
|
|||||
|
Re: Java versus C++
Quote:
![]() Quote:
All of this really only matters if you are in a hard-real time, safety-critical situation. If for example you are building an airbag deployment system, you have a few milliseconds to react to a crash. In this scenario you can't afford the one in a million chance that your code is busy garbage collecting and thus blocking the execution of the real-time critical bit. In a FIRST robot, missing a real-time deadline by a little bit is (a) not going to be life threatening and (b) not going to occur often at all anyway. The worst possible scenario would be a fast software control loop ending up with a little bit more jitter (variation in time between calls). Last edited by Jared Russell : 22-09-2010 at 19:33. |
|
#20
|
|||
|
|||
|
Re: Java versus C++
Quote:
I'm sorry, but I can't help but misread JVM as JVN, at least in an FRC context. |
|
#21
|
|||
|
|||
|
Re: Java versus C++
While I'm pretty sure I can build a car that operates more slowly than a bike, or find a turtle that outruns a hare, I'd caution against drawing general conclusions from such benchmarks.
One of the fundamental underpinnings of computer science is examining a problem and determining the inherent complexity, looking at a solution and determining the way it scales based on it's inputs, and getting beyond qualitative terms such as fast and slow. You have choices as to which tools to use, and I wouldn't personally base the decision on runtime performance. Instead look what will support agility, productivity, and reliability. Also consider what enables your team to learn new things and to pass the knowledge on to the next generation of your team. Greg McKaskle |
|
#22
|
|||
|
|||
|
Re: Java versus C++
Quote:
If you know what I mean, I don't name what I do. |
|
#23
|
||||
|
||||
|
Re: Java versus C++
Quote:
|
|
#24
|
|||
|
|||
|
Re: Java versus C++
As far as I know, Squawk (or any other J2ME implementation I've heard about) doesn't support JIT, so cRIO-java is stuck in interpreted mode. This likely ends up slowing down any particularly intensive logic-only calculations due to the lack of native code execution. One of the biggest speed boosts in desktop Java (and some other loosely Java-based systems like Android) are JIT-related. For some context, the JIT support added to Android in the latest release gave it around a 50% speed boost.
Overall, though, the cRIO is powerful enough to accommodate basically anything we'll need to do with our bots. Maybe Vision-related stuff would suffer a slowdown, but for the most part that's offloaded to (prebuilt) native libraries. Having used Java this year, I can say that there were a few performance-related issues, but a lot of them were due to us having a pretty large number of simultaneous threads running (one being unused vision processing which happily ate away at our CPU time). In the end, a quick sweep through some of the unused code cleared it up. And it definitely won't stop us from using Java again this year - the issues we had there were nothing compared to our trouble with LabVIEW and C++ in '09. |
|
#25
|
|||||
|
|||||
|
Re: Java versus C++
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| **FIRST EMAIL**/Java and Orbit Balls *****JAVA DISCUSSION*** | Pjohn1959 | Programming | 37 | 31-08-2009 15:55 |
| Cable Versus Chain | Darren Collins | Technical Discussion | 1 | 14-01-2008 22:29 |
| Bernoullis versus Continuity | Corey Balint | Math and Science | 13 | 15-09-2007 17:59 |
| PC versus Console | Denman | Chit-Chat | 40 | 22-05-2005 18:01 |
| Reigonals versus startegies | MisterX | Rules/Strategy | 11 | 29-03-2004 00:04 |