Prev: Oops
Next: Construct a superclass as itself
From: Marcin Rzeźnicki on 14 Nov 2009 13:15 Hi all, Is there any way to see what is the effect of JIT compilation on my code? Ideally I'd like to see whether a method has been inlined, if not then what prevented it - maybe some code output (like gcc's -S), stuff like this. I am not sure whether it is even possible, so I just thought I'd ask.
From: markspace on 14 Nov 2009 13:40 Marcin Rzeźnicki wrote: > Hi all, > Is there any way to see what is the effect of JIT compilation on my > code? Ideally I'd like to see whether a method has been inlined, if > not then what prevented it - maybe some code output (like gcc's -S), > stuff like this. I am not sure whether it is even possible, so I just > thought I'd ask. I'm not sure, but HotSpot has the option: -XX:-PrintCompilation Print message when a method is compiled. <http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp> That seems to do something with compilation. You might try it out and see what sorts of stuff it reports. I tend to agree that sometimes it would be useful to have insight into exactly what and how optimization was occurring.
From: Marcin Rzeźnicki on 14 Nov 2009 14:06 On 14 Lis, 19:40, markspace <nos...(a)nowhere.com> wrote: > Marcin Rzeźnicki wrote: > > Hi all, > > Is there any way to see what is the effect of JIT compilation on my > > code? Ideally I'd like to see whether a method has been inlined, if > > not then what prevented it - maybe some code output (like gcc's -S), > > stuff like this. I am not sure whether it is even possible, so I just > > thought I'd ask. > > I'm not sure, but HotSpot has the option: > > -XX:-PrintCompilation -XX:+PrintCompilation if you wanna have it on :-)  Print message when a method is compiled. > > <http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp> > > That seems to do something with compilation.  You might try it out and > see what sorts of stuff it reports.  I tend to agree that sometimes it > would be useful to have insight into exactly what and how optimization > was occurring. It is actually not that useful as it just prints when JITc compiles something but does not tell you what is the reason for the behavior you are observing (maybe there are some switches). I've found something possibly better -XX:+LogCompilation - but it is mentioned only on OpenJDK wiki, I am not sure what is the relation between Sun's Hotspot and OpenJDK. Anyway, if I make it work the problem still remains, as its expected output is probably not very clear to someone who was not working on Hotspot compiler :-) I'll be searching for a more 'user friendly' tool.
|
Pages: 1 Prev: Oops Next: Construct a superclass as itself |