View Single Post
  #28   Spotlight this post!  
Unread 08-11-2012, 09:53 PM
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: C++ vs. Java (speed considerations only)

Java has a lot more overhead than C++. For example, the JVM itself needs to use the same registers, caches and RAM that the Java Program would use. Also, a Java Object has at least 8 bytes of overhead (because of the instruction pointers). If you caste a type, you have to copy it since Java just does not read it as the type you are converting to. Take for example, if you have a 32 bit integer in memory in C++, you can caste it to read in as a short (16 bits). It will only read the first 16 bits. But since everything is an object in Java, the memory simply cannot be read as 16 bits. It needs to be copied.
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.