I noticed sun is providing a 64bit version of Java. Does it perform better than the 32bit version?
Define your workload and what "perform" means to you.
This is sort of a running annoyance to me, as a performance geek of long standing. Whether or not a particular change "performs better" or not is dependent, first and foremost, on the workload, ie, what you're asking the program to do.
64 bit Java will often perform better on things with heavy computation loads. Java programs, classically, have heavy I/O loads and heavy network loads; 64 bit vs 32 bit may not matter, but operating systems usually do.
Yes, especially if your code is built to target a 64 bit platform.
On most CPU architecures 32-bits is faster than 64-bit, all else being equal. 64-bit pointers require twice as much bandwidth to transfer as 32-bits. However, the x64 instruction set architecture adds a bit of sanity over x86, so ends up being faster. The amount of handling of long types is usually small.
Of source it also depends upon the implementation of Java. As well as the compiler you might find differences in implementation, for instance NIO assumes 64-bit pointers. Also note that Sun previously only shipped the faster server HotSpot implementation for x64. This meant that if you specified -d64, you would also switch from client to server HotSpot, IIRC.
some improvements: operations with doubles on 64bit compute equally fast as floats on 32 bits, as well as operations on long at 64bit compared to int.
so if you are running code with tons of longs you might see a real improvement.
Almost always 64 bits will be slower.
To quote Sun from the HotSpot FAQ:
The performance difference comparing an application running on a 64-bit platform versus a 32-bit platform on SPARC is on the order of 10-20% degradation when you move to a 64-bit VM. On AMD64 and EM64T platforms this difference ranges from 0-15% depending on the amount of pointer accessing your application performs.
There are more details at the link.
64-bit perform better if you need much more than 1.2 GB. On some platforms you can get up to 3 GB but if you want 4 - 384 GB for example, 64-bit is your only option.
I believe Azul supports a 384 GB JVM, does anyone know if you can go higher?