views:

113

answers:

1

Does the NetBeans CPU Profiler use Wall Clock Time or CPU Time? This is important to know, for example, when thinking about how I/O will be reflected in your profiling results.

+2  A: 

The NetBeans default is to use wall clock ("absolute") time for all method timing calculations. A CPU time approach is available, but currently only on Solaris. If CPU time is desired, it can be enabled from the "Advanced settings" area in the "Attach Profiler" window. (The option is called "Use thread CPU timer (Solaris only).")

Regardless of which timer setting is chosen, that setting applies globally to all classes/methods. (For contrast, YourKit allows you to time certain methods using CPU time but other methods using wall clock time.)

Note that, regardless of timer mode, NetBeans does correct its timing info to take into account profiler overhead.

As for I/O: With the default (wall clock) setting, method timings will theoretically include time spent blocking on I/O operations.

More details about the timer options can be found at http://wiki.NetBeans.org/FaqProfilerUsingTimers. I found it helpful to consult that page together with http://wiki.netbeans.org/FaqProfilerSampledInstrumentation, which describes how instrumentation works in both "Exact Call Tree and Timing" mode and "Exact Call Tree, Sampled Timing" mode.

Chris