• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

JProfiler & CPU Time vs. Response Time

Posts: 1
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
Posts: 6663
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic