Timing Anomalies of Source ProfilerLast reviewed: July 18, 1997Article ID: Q103785 |
1.00 1.20 1.30 | 1.00 1.20 | 1.00 1.20 1.30
MS-DOS | OS/2 | WINDOWSkbtool kbcode The information in this article applies to:
The information in this article is included in the documentation starting with Visual C++ 5.0. Look there for future revisions.
SUMMARYProfiling applications with Microsoft Source Profiler may produce inconsistent and incorrect timing information in some cases. The information below describes such situations.
MORE INFORMATIONProfiling applications on systems that have built-in memory caches or disk caches may produce erratic time reports. The number of instructions from the application's code and the profiler's code that gets loaded in the cache cannot be controlled, and this causes the timing inconsistencies. Profiling applications under Windows versions 3.0 and 3.1, when other tasks are running, may produce incorrect timing information on the applications being profiled. This problem is caused by the time spent on other tasks being attributed to the application being profiled. The profiler must compensate for Windows protected-mode and device-driver overhead when recording timing information. This can cause timing by line and timing of short functions or procedures to be inaccurate. These inaccuracies can accumulate and cause the total program execution time shown by the profiler to be greater than the actual time taken by the program. In general, Windows standard mode gives better timing results than 386 enhanced mode. In the case of FORTRAN programs compiled using Microsoft FORTRAN versions 5.0 and 5.1 with the /4Yb compiler option (or $DEBUG metacommand), additional code is generated for expanded error handling, and this may result in an increase in the Profiler timing information.
Sample CodeProfiling the following FORTRAN code compiled with and without the /4Yb option (or the $DEBUG metacommand) reports significant time difference on the first line of the code where the function call is made:
a=func(4.0) print*, a end function func(s) func=sqrt(s) return end |
KBCategory: kbtool kbcode
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |