Determines which result is used to sort the list of profiled symbols. It may be one of three values :
:call
-- sort by the number of times each function was called.
:profile
-- sort by the number of times the function was found on the stack.
:top
-- sort by the number of times the function was found on the top of the stack.
If
sort
is omitted then the profiled symbols are printed as after the profiling run. The default is the value of the variable
hcl:*default-profiler-limit*
, which itself has default value
:sort
.
The maximum number of symbols to print. The default is the value of the variable
hcl:*default-profiler-sort*
, which has the default value 100,000,000.
Returns a tabulated list of symbols, displayed within the parameters defined in any arguments given.
After profiling a Lisp form using the function
profile
, the symbols profiled may be printed out in order using
print-profile-list
. Thus, for example, the symbols found most often on the top of the stack can be quickly found.
print-profile-list
prints out a tabulated list of all the symbols which have been profiled showing how often each was called, profiled and found on the top of the stack.
USER 4> (set-up-profiler :symbols '(car cdr maphash +))
USER 5> (profile (dotimes (a 100)
(print (+ a a))
(print car '(foo))))
Then call
print-profile-list
:
USER 6> (print-profile-list :sort :call)
profile-stacks called 24 times
Symbol called profile (%) top %)
+ 100 1 ( 4) 1 ( 4)
CAR 100 0 ( 0) 0 ( 0)
SYSTEM::DUMMY-STRUCTURE-ACCESSOR 12 0 ( 0) 0 ( 0)
SYSTEM::DUMMY-STRUCTURE-SETTER 12 0 ( 0) 0 ( 0)
MAPHASH 1 0 ( 0) 0 ( 0)
Top of stack not monitored 96% of the time
You can suppress printing of those symbols that are currently profiled but which were not called in the profiling run by setting
system:*profiler-print-out-all*
to
nil
.
system:*profiler-print-out-all
* is a variable defined when the profiler is loaded by
set-up-profiler
. Its initial value is
nil
.