Timing Anomalies of Source Profiler

Last reviewed: July 18, 1997
Article ID: Q103785
1.00 1.20 1.30 | 1.00 1.20 | 1.00 1.20 1.30
MS-DOS         | OS/2      | WINDOWS
kbtool kbcode

The information in this article applies to:

  • Microsoft Source Profiler for MS-DOS, version 1.0, 1.2, and 1.3
  • Microsoft Source Profiler for OS/2, version 1.0 and 1.2
  • Microsoft Source Profiler for Windows, version 1.0, 1.2, and 1.3

The information in this article is included in the documentation starting with Visual C++ 5.0. Look there for future revisions.

SUMMARY

Profiling applications with Microsoft Source Profiler may produce inconsistent and incorrect timing information in some cases. The information below describes such situations.

MORE INFORMATION

Profiling 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 Code

Profiling 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
KBSubcategory: TlsMisc
Additional reference words: 1.00 1.20 1.30 3.00 3.10 5.00 5.10
Keywords : kb16bitonly TlsMisc kbcode kbtool
Version : 1.00 1.20 1.30 | 1.00 1.20 | 1.0
Platform : MS-DOS OS/2 WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 18, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.