Profiler - Profiling Results - Code Fragment

Home > Profiling Results

Profiling Results - Code Fragment

When you analyze code fragment performance, the results in the Profiling Results tab displays the time it takes to execute an piece of code within one method, or the whole method.

Code fragment performance is profiled when you choose the Analyze Code Fragment Performance command.

To open the Profiling Results tab, click the Live Results button ( Live Results ) in the Profiler window.

The Profiling Results tab

When you analyze code fragment performance, the results appear as a list in the Profiling Results tab.

The length of this list is the smaller of the following two values:

  • The number of times that this code region has actually been executed
  • The size of the code region CPU results buffer.

Code Region Tab

How code fragment performance is measured

The CPU results buffer is a ring buffer kept in the target JVM memory; by default its size is 1000 elements. The size can be changed in the Custom Profiling mode. Note that when you shut down the target JVM, the results contained in this buffer are lost, thus you should invoke choose Profile -> Reset Collected Results while the target VM is still active (though the target application could have completed execution by that time).

When measuring code fragment performance you measure the time it takes to execute an arbitrary piece of code within one method, or the whole method. It is as if you inserted two System.currentTimeMillis() calls into the code of your target method (or more, if there are any return statements within this piece of code) and then calculated the difference. Profiler, however, uses a high-resolution timer and automates the whole process, allowing you to insert/remove as many timers as you want while your application is running. Only one timer can be active at any time, however.

See also


Project Features

About this Project

Profiler was started in November 2009, is owned by Tomas Hurka, and has 62 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20160708.bf2ac18). © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
Please Confirm