AW: [plt-scheme] Question on profiling

From: Matthew Flatt (mflatt at
Date: Thu Mar 5 09:01:27 EST 2009

The files that are profiled are the ones that do not have bytecode
".zo" files. So, if your main module `require's another module that
doesn't have a ".zo" file, then the `require'd module is also profiled.

Profiling usually stops at libraries, because they usually have
bytecode files installed.

At Thu, 5 Mar 2009 14:54:00 +0100, "Ballnat, Stefan" wrote:
> Thanks, that made it more clear.
> But is there a way of multiple library profiling? For example, to open the 
> library where the tailed-call function is defined (analogue to multiple file 
> debugging).
> Our project consists of about 30 self-written and a lot more imported 
> libraries. And profiling every single library cannot be the solution (at 
> least, I hope so).
> - Stefan
> -----Ursprüngliche Nachricht-----
> Von: Matthew Flatt [mailto:mflatt at] 
> Gesendet: Donnerstag, 5. März 2009 14:22
> An: Ballnat, Stefan
> Cc: plt-scheme at
> Betreff: Re: [plt-scheme] Question on profiling
> This may be because the time attributed to a function does not include
> tail calls from the function, and maybe your program is spending all
> its time in library functions that are tail-called.
> For example, profiling
>  #lang scheme
>  (define (all i)
>    (if (zero? i)
>        'done
>        (begin
>          (compute i)
>          (all (sub1 i)))))
>  (define (compute i)
>    (build-list i add1))
>  (all 10000)
> shows that all the time is in `all', but almost no time is in
> `compute'. Most of use would be inclined to say that all the time in
> this program is in `compute' during the call to `build-list'. From the
> profiler's perspective, however, the call to `build-list' is not inside
> `compute', since it's a tail call.

Posted on the users mailing list.