• Post Reply Bookmark Topic Watch Topic
  • New Topic

performance of Java on Linux vs Windows  RSS feed

 
Ivan Jouikov
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was talking to my dad and he told me that on Linux, Java Virtual Machine is built so that bytecode is executed on processor-level, whereas on Windows, Java Virtual Machine is ran as sort of an "emulator", and bytecode is executed by a program, which is then by the proccessor.

This doesn't make much sense to me, and I was wandering if someone could give me more insight on this.

Thanks in advance.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
your father is wrong.
On both Windows and Linux (and every other platform except maybe some obscure ones like specially designed smartcards) the virtual machine executes the bytecode and uses the operating system where needed.
The operating system will then call the hardware.

In my experience there's little difference in performance except in areas where one OS is superior to the other.
For example, graphics performance on Linux is generally poor compared to Windows (especially X is slow) which reflects on Java programs with GUIs (Swing, AWT, etc) running faster on Windows than they do on Linux (so quite the reverse of your father's claim in fact).

character based applications should run about as fast on identical hardware with a similar amount of optimisation performed.
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well - I guess it's more complicated.
You may build the kernel not only with classical lib-elf binary-support, but with kernel/fs/binfmt_misc support too.
will show you, if it is available as module.
This shall enable to execute classes like executables; I guess instead of:

you may run

But I didn't made own experiences.

It was meant to lead to a faster execution AFAIK.
But todays JVMs are faster than when the project started, and a great improvement is made by JIT-compiling, which can lead (and often leads) to faster code, than natively bound code.
And - again not sure about it: - the execution of classes is made by a wrapper, so there shouldn't be a great difference in speed, I think.

If you have the kernelsources with docs, here is more info:
file:///usr/src/linux/Documentation/java.txt

Here is something on the web - but I didn't find a date - perhaps it's really old:
http://www.linuxhq.com/java.html

But please tell us, if you find actual informations, or make interesting experiences.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can, but that will still use a JVM AFAIK.
And it'll fix the version number of that JVM to whatever the kernel distributors thought to include.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!