Types of Measurements

HP Caliper is capable of three types of performance measurement:

A global measurement of total run metrics

A sampled measurement based on the granularity you specify

A precise measurement of every execution path in your code (HP-UX only) See Table 1 (page 44).

Global Measurement

A global measurement gives you a single value for a specific metric of your program, such as total CPU time used.

The only global measurement available in HP Caliper is ecount (total CPU time).

A global measurement is best used for:

Comparing the effect of different types of test data that your program processes

Comparing the benefits of different compile-time optimization settings

Detecting performance regressions caused by program modifications

You can use a global measurement to help you identify what performance areas of your program to investigate further.

The advantage of a global measurement is that it does not affect your program's performance.

The disadvantage of a global measurements is that it does not identify specific parts of your program that might benefit from optimization.

Sampled Measurements

A sampled measurement measures your program's performance at regular intervals, based on CPU events, recording the current program location and selected performance metrics.

A sampled measurement is best used for:

Identifying where your program is spending time

Identifying approximately where events such as cache misses occur

Determining the performance effect and location of branch mispredictions

You can use sampled measurements to focus your analysis on specific parts of your program.

The advantage of sampled measurements is that they can help you localize performance issues in your program.

The disadvantage is that they might miss very fast, seldom-called code. You might need to adjust HP Caliper settings, such as the sampling frequency, to help locate events in your code.

Sampled measurements also require more resources, such as system memory, which might affect the run-time performance of your program or limit the amount of information you can collect.

You can control the tradeoff between resource usage and accuracy of the results by changing the sample interval.

Precise Measurements

A precise measurement gives you exact information about what is happening and where events are happening in your program. When you use a precise measurement, HP Caliper dynamically instruments your binary program while it is running to enable the collection of information.

26 Getting Started with the HP Caliper Command-Line Interface