File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Performance and the fly likes JProfiler & CPU Time vs. Response Time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "JProfiler & CPU Time vs. Response Time" Watch "JProfiler & CPU Time vs. Response Time" New topic
Author

JProfiler & CPU Time vs. Response Time

Michael Baran
Greenhorn

Joined: Nov 14, 2012
Posts: 1

Hi all, I've been tasked with using JProfiler to find the response time of an application. While JProfiler has been nice to use and offers boatloads of data, nowhere can I find the term "response time" used in reference to JProfiler, using the JProfiler reference guide, Google, and the app itself. I keep being told that other tools, notably HP Mercury Diagnostics, display both response time and CPU time at the method level in their call traces, but JProfiler only displays one metric. I've also looked into some other java profilers and one named Jensor speaks only of "response time" and nothing about CPU time.

I take the difference between CPU time and response time to be that the latter includes the CPU time + I/O.

I recently came across this (starting in the "CPU Profiling" section) which explains how JProfiler's CPU View can be adjusted to display elapsed time (the default) or estimated CPU time. I'm thinking this may be the answer I'm looking for, where elapsed time is equivalent to what we mean when we say "response time", but wanted to get some other opinions on the subject.
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

We need to nail down the definition of jargons and terminology before answering this question.

Jprofiler terminology

Inherent time - The time taken by the method alone. If method A takes 5 seconds to execute and calls method B which takes 2 seconds to execute, the inherent time of A is 3 seconds.
Total time - Inherent time + Time taken by methods called by the method being profiled. In the first example total time is 5 seconds.
Average time - Total Inherent time / Invocation count. If method A is called 5 times and takes a sum total inherent time of 5 seconds to respond, the average time is 1 second.
CPU time - The real time that was spent in the method by the CPU, taking into consideration OS time scheduling algorithms that would have stolen some time to execute other methods.

I have not encountered the term 'response time' anywhere on jprofiler. I believe what you mean by response time is the total average time taken by a method A. This can be calculated by taking Total time and dividing that by invocation count. Right click on a node in the 'hot spot' view and look at the 'call tree'. This view gives you the total time and invocation count of the node in question.

If you require the average inherent time, use the 'Average time' number provided by jProfiler.

CPU time is quite different from response time for a couple of reasons. Your bottleneck may not reside on CPU restrictions. As correctly noted by you there may be I/O blockages that affect response time. For most applications I/O is a bigger time sink than CPU.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JProfiler & CPU Time vs. Response Time
 
Similar Threads
JProfiler Problem - Freezes on Initialization
JProfiler Help Needed
Question on Java profiler
How to interpret multi-thread test results
Does rendering outside the canvas still use CPU?