I challenge your assertion that Java is slower, and point to the runtime and Just-In-Time compilers that Java has now that, with more information about how a program is used, are able to generate more efficient machine code than would otherwise be possible (which branch of this if should I optimize for? Let it run a few thousand times and you have your answer!).
Compilation is one of the slowest processes in any language. Time spent doing Just-In-Time-Compilation is time spent not running the program, as is time spent testing branches a few thousand times instead of using the processor's own general-case branch prediction. Being able to map code into memory and go is an incredible advantage in terms of load times, not to mention taking advantage of virtual memory in a way Java cannot. There comes a point where the weight of complexity outstrip the utility of it, especially when reinventing things already handled competently by the OS or even the hardware itself.
Part of the purpose of Java was that it handled those things in a way that let you run the same Java code on whatever hardware you wanted, through the Java virtual machine. No need to port from one OS to another or anything like that. Java does take longer to load than a native application, true, but for most normal things (processes running for more than a minute or so), the impact of the compiler is usually a net positive. The branch prediction isn't a replacement for hardware branch prediction, it's re-generating the bytecode to make the common case more efficient. More information (and helpful links!) on
wikipedia.
My main issue with Java is that it is impossible to write a small, simple program. Even the tiniest 'Hello World' invokes the full might of the hundred-megabyte compiler-interpreter-language-suite monster.
Besides, compilers in general have gotten more sophisticated, not just Java's.
My entire JDK is 100MB. I'm not sure what you are using that invokes hundreds of MB of java, but I assure you things have gotten smaller. With the introduction of the JIT and interpreted mode, it doesn't even bother starting to compile things unless it thinks it's going to be worth it. I'm also not sure why you care about the full might being invoked, since I still get sub-100ms startup times for my JVMs. I'm sorry if I come off as somewhat defensive and abrasive, but I get annoyed at people complaining about things that have been fixed since Java 1.4 or so.
Lower level stuff (like hardware-accelerated graphics) is lower level stuff, and so of course won't be run in a higher-level language like Java. Similarly, special-purpose hardware (or special-purpose languages) will almost always be faster than software (or general-purpose languages)
There are general-purpose languages with perfectly acceptable performance.
For graphics rendering? I think not...
they surrender flexibility for speed, and get to make domain-specific optimizations that they can't otherwise make (graphics chips are horrible at any code that involves branches. Graphics rendering involves no branches. Not being good at branches lets them do matrix operations much faster. Graphics rendering involves a lot of matrix operations.)
Nonetheless, all code that runs in a PC's CPU ultimately uses the same instructions to do the same things.
That's true, to a point, within something like "Intel Xeon x86 chips". They all support the same instructions coming in, but how they handle them internally varies quite a lot by processor family, manufacturer, etc. How much optimization you can do to the code as you compile it down can vary greatly, as well, mostly based on how much information you have about the code being executed. In the case of the graphics example you were using, that's going to run on the graphics card, which is not an x86-supporting chip and does not have the same instruction set as the general CPU. It has a set of instructions (and by extension, a set of hardware instruction paths) that is very narrowly focused on doing graphics operations very quickly.
There is no One Language to Rule Them All.
Of course not. This has nothing to do with the argument, of course, since considering Java cumbersome and slow does not malign all other languages.They have strengths and weaknesses (readability, coding speed, execution speed, library support), and to pretend that a single language is always suited or unsuited is a mark of poor programming skill.
Good thing nobody said or implied that then.
I apologize for interpreting your post that way, then, since it seemed like you were maligning Java for being unable to keep up with a special-purpose rendering tool. As I mentioned above, I do somewhat take issue with claiming that Java is cumbersome and slow, but that's an entirely different argument.