0.8.12.39:
[sbcl.git] / contrib / sb-sprof / sb-sprof.texinfo
1 @node sb-sprof
2 @section sb-sprof
3 @cindex Profiler
4
5 The @code{sb-sprof} module provides an alternate profiler which works by
6 taking samples of the program execution at regular intervals, instead of
7 instrumenting functions like @code{profile} does. You might find
8 @code{sb-sprof} more useful than @code{profile} when profiling functions
9 in the @code{common-lisp}-package, SBCL internals, or code where the
10 instrumenting overhead is excessive.
11
12 This module is known not to work consistently on the Alpha platform,
13 for technical reasons related to the implementation of a machine
14 language idiom for marking sections of code to be treated as atomic by
15 the garbage collector;  However, it should work on other platforms,
16 and the deficiency on the Alpha will eventually be rectified.
17
18 @subsection Example Usage
19
20 @lisp
21 (require :sb-sprof)
22 (sb-sprof:start-profiling)
23
24 (defvar *a* 0)
25 (dotimes (i (expt 2 26))
26   (setf *a* (logxor *a* (* i 5)
27                     (+ *a* i))))
28
29 (sb-sprof:stop-profiling)
30 (sb-sprof:report)
31 @end lisp
32
33 @subsection Functions
34
35 @include fun-sb-sprof-report.texinfo
36
37 @include fun-sb-sprof-reset.texinfo
38
39 @include fun-sb-sprof-start-profiling.texinfo
40
41 @include fun-sb-sprof-stop-profiling.texinfo
42
43 @subsection Macros
44
45 @include macro-sb-sprof-with-profiling.texinfo
46
47 @subsection Variables
48
49 @include var-sb-sprof-star-max-samples-star.texinfo
50
51 @include var-sb-sprof-star-sample-interval-star.texinfo
52    
53 @subsection Credits
54
55 @code{sb-sprof} is an SBCL port of Gerd Moellmann's statistical profiler
56 for CMUCL.