Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on Java profiler

 
Vaishali Gulve
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Onkar Joshi
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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???
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic