Share via


Onboard System Memory Cache and Disk Caches May Affect Profile Times

OverviewHow Do I

Feature Only in Professional and Enterprise Editions   Profiling is supported only in Visual C++ Professional and Enterprise Editions. For more information, see .

The Microsoft Source Profiler may display erratic execution times on any system with an Intel 80386 or 80486 processor that has a built-in memory cache. The only effective way to work around this is to disable the cache, because there is no way to control what is cached and what is not cached.

The erratic profile results are caused by the way a memory cache of this type operates. If code from the program being profiled is in the cache, the execution times will be less than normal. On the other hand, it's likely that the cache will be dominated by the Profiler itself, since the instructions from the Profiler's own code will usually be in the cache. This may then result in increased times for the program being profiled. Caching will also affect small programs more than large ones because of the successful hit rate in the cache.

Because memory caching hinders accurate profiling, a system without a cache should be used while profiling to ensure the most reliable times. In any case, the overall effect of a cached system should be that it runs faster, so it should not be necessary to consider this net gain when profiling.