[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.7.7.3 Profile

The virtual machine supports a profiling capability by way of this feature. Profiling an application causes run time statistics about it to be written to a file ‘./profile.txt’. Profiled applications are of the form indicated in the following theorem

T12

[[profile]] (f,s) = ((nil,nil),((nil,nil),(nil,((f,s),nil))))

where f stands for the virtual code of the application, and s stands for the name of it to be written to the file. The semantics of a profiled function is identical to the unprofiled form for any non-nil f.

P9

([[profile]] (f,s)) x = f x

Unlike the situation with note, the annotation s of used in profiled code is not in an unrestricted format but must be a character string in the standard representation (as in Representation of Numeric and Textual Data), because this string needs to be written by avram to the file ‘./profile.txt’. Ordinarily this string will be the source code identifier of the function being profiled.

When profiles are used in many parts of an application, an informative table is generated showing the time spent in each part.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on December 10, 2012 using texi2html 1.82.