3 The MLWorks Pervasive Library

3.4 Profiling: the Profile structure

The Profile structure provides a programmatic interface to the MLWorks profiler. Because this programmatic interface is richer than that provided by the GUI environment's profiler tool, you may want to use it in preference to that tool.

There are three kinds of profiling available: time profiling, space profiling, and call-counting. You can also specify the frequency with which the profiler should scan the stack, in milliseconds.

The profiler supports the notion of a profiling manner, which is a convenient way of specifying the kind of information the profiler should gather. A manner might specify that only call-counting should be done, and that the number of garbage collections that occurred during the execution of the function should be recorded.

When the function call is complete, the profiler returns the results of the call and the results of profiling.

Note: The profiler interface contains some details pertaining to cost-centre profiling. That style of profiling may be implemented in a future release.

The following sections explain the use of the profiler in more detail. The example code here does not qualify identifiers with an MLWorks.Profile prefix for the sake of brevity; you should add this prefix yourself, or use local open MLWorks.Profile in ... end, in order to run these examples.

3.4.1 - Code items
3.4.2 - Invoking the profiler
3.4.3 - Profiling manners
3.4.4 - Specifying scan frequency and profiling manner details
3.4.5 - Profiling results
3.4.6 - Time profiling
3.4.7 - Space profiling
3.4.8 - Profiler performance data
3.4.9 - Profile structure values

MLWorks Reference Manual (version 1.0) - 3 DEC 1996

Generated with Harlequin WebMaker