Is it optimized at run-time by the JVM
only or also at compile-time ?
Java compilers typically do very little optimization (apart from resolving compund literals), since "optimized" bytecode may impede the ability of the JIT compiler to optimize - and that's where it really matters.
Or are JVM optimizations powerfull
enough so that I just have to write
code that is readable and easy to
maintain regardless of speed
performances?
It's not a question of trusting in the JVM to optimize better than you do (though this is definitely a factor), it's a question of optimization being completely irrelevant 95% of the time, since the code is not executed frequently. If a piece of code accounts for 0.1% of your app's execution time, it's simply not worth bothering with. Even if you can speed it up 100 times, it gains you nothing. And this is the most common case.
As long as you avoid blatantly stupid things, you should forget about optimization until you have a concrete performance problem, and then only optimize exactly the pieces of code that a profiler tells you are hot spots in your code.