[plt-scheme] profiling doesn't show any data -- why?

From: Robby Findler (robby at cs.uchicago.edu)
Date: Sun Mar 5 22:13:39 EST 2006

The line:

  (require (lib "errortrace.ss" "errortrace"))

changes the behavior of the eval handler when it itself is evaluated
(the parameter settings are similar -- they affect the new eval handler
installed by the above). So, subsequent expressions will be profiled,
but not the one expression you're evaluating (as in the case below)

Instead of the below, put the following into a file, say `profile.ss'

     (require (lib "errortrace.ss" "errortrace"))
 
     (profiling-enabled #t)
     (profiling-record-enabled #t)
     (profile-paths-enabled #t)
     (require "file-to-be-profiled.ss") 
     (output-profile-results #t #t)

Where file-to-be-profiled.ss contains a module that runs the code
you're interested in profiling. Then, do this:

  mzscheme -qr profile.ss

Alternatively, you can turn on profiling in DrScheme's language dialog
(in the show details section of the dialog, for languages that support
profiling).

hth,
Robby

At Sun, 05 Mar 2006 17:50:00 -0800, Eric Hanchrow wrote:
> 
> This is on Debian Sarge 
> (Linux debian 2.4.27-2-686 #1 Mon May 16 17:03:22 JST 2005 i686 GNU/Linux)
> 
> $ mzscheme --version
> Welcome to MzScheme version 301.4, Copyright (c) 2004-2006 PLT Scheme Inc.
> 
> $ time mzscheme  -qu profile.scm
> 832040
> Sorting profile data...
> Total samples: 0
> 
> real	0m0.481s
> user	0m0.420s
> sys	0m0.020s
> Total samples: 0
> 
> I expected to see a large number after "samples", and a list with one
> entry for "fib" which says something like "called 832040 times".
> 
> As you can see, the program runs for a reasonably long time, long
> enough, I expect, for some samples to be collected.
> 
> I assume I'm missing something obvious, but (obviously!) haven't
> figured out what it is.
> 
>     (module profile
>     mzscheme
>     (require (lib "errortrace.ss" "errortrace"))
> 
>     (profiling-enabled #t)
>     (profiling-record-enabled #t)
>     (profile-paths-enabled #t)
> 
>     (define (fib n)
>       (cond
>        ((zero? n)
>         0 )
>        ((= n 1)
>         1)
>        (else
>         (+ (fib (- n 1))
>            (fib (- n 2))))))
> 
>     (display (fib 30))
>     (newline)
>     (output-profile-results #t #t)
>     )
> 
> -- 
> Paul Graham is right.
>         --Shriram Krishnamurthi
> 
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme


Posted on the users mailing list.