The Sampling profiler polls the application during its execution and helps you estimate how much time the application spends inside each function, file or module. This topic provides an overview of the profiler:
The Sampling profiler helps you make a quick overall look at the application’s performance. It polls the profiled application at certain intervals and determines the routine that is currently being executed. It increases the sample count for that routine and reports the number of collected samples in results. In other words, it reports the number of times a routine was found executed during the application run. The profiler also reports approximate time spent on the routine’s execution.
For better results, we recommend that you use a computer that has at least a quad-core CPU. Otherwise, the Sampling profiler may collect inaccurate data due to specifics of its functioning.
You can sort out the profiling results on the sample count or time values and easily find the functions that tend to take much time during the application run. There may be two possible reasons for this: the function is called too frequently during the application run, or the function is working slowly. In either case, such a function is a primary candidate for optimization.
With the Sampling profiler, you can analyze the performance of 32-bit and 64-bit native (unmanaged) applications. Your applications should be compiled with debug information. (see How AQtime Profilers Use Metadata and Debug Information).
The Sampling profiler can analyze the application code at two levels of detail: routine and line. To profile the lines of a routine, add the desired routines to line-level areas.
The Sampling profiler does not support triggers and actions, however, you can still control profiling with the Enable/Disable Profiling button.
The Sampling profiler is similar to the Performance profiler as it helps you analyze the application performance. You can use it to pinpoint potential bottlenecks in your applications. Due to its specifics, the Sampling profiler works much faster than the Performance profiler. However, the Sampling profiler collects less accurate and detailed data than the Performance profiler; it does not trace the hierarchy of function calls, nor does it collects data on child methods. It can also overlook some “quick” functions that start and complete their run during the interval between two samples.
Generally, you can use the Sampling profiler for initial exploration of the application performance. If you have a huge application, profiling its code with the Performance profiler will take much time. To save the time, you can profile this project with the Sampling profiler first, and get the list of potentially slow functions. You can then add these functions to a line-level profiling area and profile the application with Performance profiler to get detailed information on these functions’ performance and find out what code needs to be rewritten.
The Sampling profiler polls the profiled application at preset time intervals and analyzes the current call stack to determine the routine that is being executed. If this routine was included in profiling in the Setup panel, the profiler increases the routine’s sample count by 1.
It is quite possible that the function at the top of the call stack is not included in profiling areas. It can be a system function that your application calls, or it can be some of your application functions that you did not include into profiling. In this case, the profiler will go down the call stack trying to find an “included” routine, that is, the parent routine that called that system function or your “excluded” function. If the profiler finds this parent function, it increases its sample count. Else, it considers the sample failed to hit any routine.
In other words, the sample count for a routine includes the samples collected for this routine’s instructions and the samples collected for all the child routines, which was not included in profiling. If both the parent and child functions are included in profiling, the child function’s samples will not be added to the parent function’s samples.