12.2 Setting up the profiler
Before a profiling session can start, several parameters must be set, using the function
set-up-profiler. If the profiler is invoked before any call to set-up-profiler, it calls set-up-profiler implicitly without any arguments. In many cases that is what you want anyway, and in these cases you do not need to call set-up-profiler, but in some cases you will want to change something.
There are four main areas to consider: the symbols to be profiled, the time interval between samples, the kind of profiling required, and the format of the output.
By default, all fbound symbols in the image are monitored (and, if KnowledgeWorks is loaded, also all the forward chaining rules). This setting is useful in many cases, but in some cases you will want to see information only about some subset of the symbols, which will make it easier to read the output. Use the keywords
:kw-contexts for KnowledgeWorks) to restrict the set of symbols that will be profiled.
You might want to specify the time interval between interrupts. The resolution of this value is clearly dependent on the operating system. In most cases the default value, 10ms, is adequate. This number is important, because with these statistical methods of program profiling the accuracy of the results increases with the number of samples taken.
On non-Windows systems the kind of profiling required may be set. This refers to what kind of time is monitored in order to determine when to interrupt the Lisp process. There are three possibilities for how the time interval is measured:
The time the Lisp process is actually executing plus the time that the system is executing on behalf of the process. This is called
Just the time that the process is actually executing. This is called
The actual elapsed time, called
The output can be presented as a tree of calls seen and a columnar report (style
:tree), or just the columnar report (style
:list). You can restrict the data shown in several ways, helping you to focus on the slowest parts of your program.
LispWorks User Guide and Reference Manual - 20 Sep 2017