Microsoft KB Archive/103785

From BetaArchive Wiki

Timing Anomalies of Source Profiler

Q103785



The information in this article applies to:


  • Microsoft Source Profiler for MS-DOS, versions 1.0, 1.2, 1.3
  • Microsoft Source Profiler for OS/2, versions 1.0, 1.2
  • Microsoft Source Profiler for Windows, versions 1.0, 1.2, 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 

Additional query words: kbProfiler s 5.00 5.10 kbDSupport kbdss

Keywords : kbcode kb16bitonly TlsMisc
Issue type :
Technology :


Last Reviewed: December 22, 1999
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.