Java performance: optimize

I have a java application. I need to run Java in optimization mode. I run application by java -Xoptimize somejava. But when I compile it, do I need to turn optimize on? for example: java -optimize=true somejava.java.
JianJunShenAsked:
Who is Participating?
 
ksivananthConnect With a Mentor Commented:
that is just a runtime flag, don't have to specify it while compiling!
0
 
CEHJConnect With a Mentor Commented:
Optimise is a runtime thing, so no
0
 
GenroseSusaiConnect With a Mentor Commented:
Indeed the sun java compiler does not have an optimize flag. Optimization mainly happens in the hotspot runtime.
0
 
objectsConnect With a Mentor Commented:
Java optimization is done by the vm's jit compiler (not the javac compiler), so is handled at runtime

http://stackoverflow.com/questions/4997513/javac-optimization-flags
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.