aspose file tools*
The moose likes Performance and the fly likes Question on Java profiler Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "Question on Java profiler" Watch "Question on Java profiler" New topic
Author

Question on Java profiler

Vaishali Gulve
Greenhorn

Joined: Mar 01, 2007
Posts: 1
Is there a JAVA profiler available which gives the number of machine cycles required to process a certain method, instead of just the total time spent on executing a certain method on a certain machine at a certain instant. If yes which one? If no why?
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
I doubt if you can get the number of processor cycles from any Java debugger. I don't think I've seen it in any debugger for any language, actually.

You can get the amount of CPU time taken, which is different to the amount of time that elapsed. The elapsed time might have been increased by I/O waits etc, whereas the CPU time measures only the amount of time doing actual computation.

I suppose you could just divide the CPU time by the clock cycle time to estimate the number of cycles. Whether that's what you want depends on whether you think things like cache misses - which stall the processor - should count.

JProfiler is the one I used and it certainly does offer to measure CPU time.


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Onkar Joshi
Ranch Hand

Joined: Mar 01, 2007
Posts: 116
Originally posted by Vaishali Gulve:
Is there a JAVA profiler available which gives the number of machine cycles required to process a certain method, instead of just the total time spent on executing a certain method on a certain machine at a certain instant. If yes which one? If no why?



I'm curious what kind of Java application needs such low level info. Of course, one could just be curious.

Or maybe you need to compare performance on machines of different configuration???


SCJP 5 - 95% | SCWCD 1.4 - 88% | SCBCD 5 - 93%
Onkar Joshi's blog | LinkedIn profile
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Question on Java profiler