Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : BULLETIN.ZIP
Filename : PROFILER.012

Output of file : PROFILER.012 contained in archive : BULLETIN.ZIP

Blink Inc. 2/29/92
Blinker's PROFILER for Clipper S87

A profiler is provided with Blinker that can monitor the execution of an
application and gather statistics for each overlaid Clipper procedure.
These statistics can assist in efforts to optimize an application's use
of memory and its execution speed.

The most recently distributed Blinker profiler was written by Fred
Stangl and the previous version was written by Craig Yellick. Their
efforts and generosity are much appreciated. Both versions can be used
with the 2.0 version of Blinker, but the specific instructions below and
those in chapter 5 of the Blinker manual refer to the latest version.

(1) The latest PROFILER.PRG is dated May 1991 or later, and contains a
credit to Fred Stangl in the first paragraph.

(2) Transfer the first paragraph of code from the PROFILER.PRG to the
main program and uncomment it. When compiled, this main .OBJ must
remain in the root portion, as the first file above the BEGIN/ENDAREA.

(3) Compile PROFILER.PRG and include "FILE PROFILER" in the root
portion of the link script just after the main file.

(4) Use the Blinker link command BLINKER CLIPPER PROFILE ON. Note,
this command replaces the older Blinker command "DEBUG". This command
will slow down the execution speed of the application, so it should be
removed from the production link script.

(5) Execute the application with the parameter "/p".
e.g. C:\> TEST /p

(6) Activate the profiler display from any Clipper wait state by
typing the key combination ALT-P.

A sample link script file for the Clipper profiler:

FILE mainprg # with code from PROFILER.PRG
FILE ...

The PROFILER.PRG has been written in Clipper, and the source code has
been supplied to encourage the addition of enhancements and
application-specific tailoring. The profiling functions within the
PROFILER.OBJ are executed by the Blinker overlay manager every time an
overlaid procedure or function is about to be executed. Therefore
statistics will only be gathered for those procedures that are placed
between the BEGIN/ENDAREA. Procedures outside the overlay area are
ignored by the profiler.

The profiler was written specifically for Summer '87 Clipper with
statistics reflecting the state of Clipper's S'87 memory management
system and Blinker's overlay manager. Of particular interest within
the data displayed, is the percentage of times that each function is
loaded from disk, compared to the percentage it is serviced from memory.

For Clipper 5.01, overlays and memory are handled differently,
deminishing the significance of some of the profiler statistics. The
command BLINKER CLIPPER PROFILER ON will disable Clipper's overlay
manager, the Dynamic Paging System, to allow the profiler to monitor
the overlaid procedures. Yet, the statistics referring to the
percentage of service from disk and from memory will not reflect the
application's actual performance once the profiler is removed and the
dynamic paging system manages the Clipper overlays. Also the memory
functions will no longer have an absolute meaning under 5.01's Virtual
Memory Management system.

One possible output statistic needs further explanation - a negative
percentage for "serviced from overlay pool". This can result while
using the fixed overlay allocation method (an optional method in S'87
and the only method in C 5.01). If a procedure is loaded into memory
when it is called, is swapped out when one of its child procedures is
called, and is reloaded when the child procedure returns to it, the
procedure is counted as having been called once, but loaded twice.

See chapter 5 in the Blinker 2.0 manual for more details and
descriptions of the format for the profiler output.

DATE 2/29/92 profiler

Copyright Blink, Inc. May not be reproduced without permission.