From: Tamas Papp
Subject: interpreting the output of a statistical profiler
Date: 
Message-ID: <87odg31n1w.fsf@pu100877.student.princeton.edu>
I am trying to improve the performance of some code.  I have invoked
SBCL's statistical profiler, and it gave me the output

           Self        Total        Cumul
  Nr  Count     %  Count     %  Count     %    Calls  Function
------------------------------------------------------------------------
   1   5249  60.3   5249  60.3   5249  60.3        -  (FLET #:CLEANUP-FUN-24)
   2    555   6.4    555   6.4   5804  66.7        -  (LAMBDA (SB-PCL::.ARG0.))

I would like to find out where (ie in which function) the first item
occurs.  What is a good strategy?

Thanks,

Tamas
From: Juho Snellman
Subject: Re: interpreting the output of a statistical profiler
Date: 
Message-ID: <slrnfept8b.dk9.jsnell@sbz-30.cs.Helsinki.FI>
Tamas Papp <······@gmail.com> wrote:
> I am trying to improve the performance of some code.  I have invoked
> SBCL's statistical profiler, and it gave me the output
>
>            Self        Total        Cumul
>   Nr  Count     %  Count     %  Count     %    Calls  Function
> ------------------------------------------------------------------------
>    1   5249  60.3   5249  60.3   5249  60.3        -  (FLET #:CLEANUP-FUN-24)
>    2    555   6.4    555   6.4   5804  66.7        -  (LAMBDA (SB-PCL::.ARG0.))
>
> I would like to find out where (ie in which function) the first item
> occurs.  What is a good strategy?

You can use a newer version of sbcl where the cleanup-fun local
function (essentially the cleanup forms of an unwind-protect form)
will contain in its name the name of the containing function. E.g.
(FLET #:CLEANUP-FUN-[FOO]).

If that doesn't help, you can use the call graph, which will be
displayed when you create the report with :TYPE :GRAPH instead of
:TYPE :FLAT. If the format of the call graph output seems too hard to
decipher, you can try slime-sprof which provides a browser for
sb-sprof results. (slime-sprof isn't part of Slime, so you'll need to
download it separately. Though it probably should be added now that
Slime has a contrib system).

-- 
Juho Snellman