[plt-scheme] Profiling...

From: Robby Findler (robby at cs.uchicago.edu)
Date: Wed Jun 14 09:24:31 EDT 2006

(lib "errortrace.ss" "errortrace") changes the eval handler, it is  
not an ordinary module in the sense that it just provides bindings.

So, you pretty much never want to require it in a module like that.

What I would do is move the require and the parameter initialization  
into a separate file (outside a module), say called "loader.ss", and  
then put (require "foo.scm") just after that and then load that file  
with mzscheme -qr loader.ss.

Robby

On Jun 14, 2006, at 8:17 AM, Matt Jadud wrote:

> Invariably, I misunderstood something in the documentation for  
> errortrace. I also made use of Danny's notes at [1] that provided a  
> few pointers.
>
> A module 'foo', saved in 'foo.scm':
>
> ==========
> (module foo mzscheme
>   (require (lib "errortrace.ss" "errortrace"))
>   (instrumenting-enabled #t)
>   (profiling-enabled #t)
>   (profiling-record-enabled #t)
>   (profile-paths-enabled #t)
>
>   ;; Perhaps I might 'require' a module here?
>
>   (define (fact n)
>     (if (zero? n)
>         1
>         (* n (fact (sub1 n)))))
>
>   (fact 5)
>
>   (output-profile-results #t #t)
>   (exit))
> ==========
>
> outputs:
>
> ==========
> [Lyra] usb > mzscheme349.100 -t-- foo.scm
> Welcome to MzScheme version 349.100, Copyright (c) 2004-2006 PLT  
> Scheme Inc.
> Sorting profile data...
> Total samples: 0
> ==========
>
> I'm a bit at a loss as to what I should do to get profiling data  
> out. I'm using the 349.100 binary for OSX, but the behavior is  
> consistent whether I use 349.100, 301.14, or 300... which implies  
> I'm doing something wrong.
>
> I'll keep looking, and probably realize some bone-headed mistake  
> myself in a minute...
>
> Cheers,
> Matt
>
>
>
> [1] http://hkn.eecs.berkeley.edu/~dyoo/plt/python-to-plt.txt
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>



Posted on the users mailing list.