[racket] profiling

From: Adam Shaw (adamshaw at cs.uchicago.edu)
Date: Thu Nov 10 10:34:39 EST 2011

Thanks -- although when I tried this a dialog popped up saying "There is no profiling information available. Please be sure that profiling is enabled..."

So, I added two lines of code above the def'n of even?:

(require errortrace)
(profiling-enabled #t)

Same dialog pops up even so.

Regards,

Adam


On Nov 10, 2011, at 9:28 AM, Shriram Krishnamurthi wrote:

> Here's a program:
> 
> #lang racket
> 
> (define (even? n)
>  (if (zero? n) true (odd? (sub1 n))))
> 
> (define (odd? n)
>  (if (zero? n) false (even? (sub1 n))))
> 
> Go to Language | Choose Language, click on Show Details, and at the
> top-right, select "Debugging and profiling".
> 
> Now run the program and in the interactions window, run
> 
>> (even? 25)
> 
> Go to View | Show Profile.  At the bottom of your screen will be the
> profiling information, showing 13 calls each to even? and odd?.
> 
> If you run
> 
>> (even? 25)
> 
> again in the interactions window, the profile doesn't appear to
> change.  But click on Update Profile (bottom-left) and it'll now show
> 26 calls each.
> 
> From there, mess around!
> 
> Shriram
> 




Posted on the users mailing list.