
Permalink for comment
On boxing/unboxing in Java
by LinuxBuddy on Fri 9th Jan 2004 01:19 UTC


On boxing/unboxing in Java, yes, you are right that this can be certainly be done. I belive the JDK 1.5 Hotspot is going to be doing this at some level. As I said, it isn't the case that Java can't go faster with better optimizations, just that such optimizations have to be done, thus adding to the complexity of the runtime.

These are language-level, structural issues that C just doesn't have to deal with. C's simple, "assembler with loops" sort of orientation is both a blessing and a curse. It's a blessing when it comes to optimization as you don't have these sorts of constraints to deal with, and frankly, the language leaves lots of implementation-dependent behavior to exploit. Java is more constrained, which eliminates broad classes of bugs that are very difficult to debug, but in return, the language exacts an overhead which the JVM compilers all seek to reduce to near-zero. Put another way, it's a lot easier to write a passable C compiler than a passable Java VM (though very difficult to write sophisticated versions of either).

Again, I love Java. It's my main programming language. I love its relatively small and simple language design with resemblance C (probably my next favorite language). With CPU speeds increasing and Java JVMs just getting better and better, I find myself programming almost exclusively in Java now.