[racket] profiling

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Thu Nov 10 10:44:49 EST 2011

Turning on profiling is an action in the Language dialog. It needs to
be set up before your program is compiled (which the below doesn't
do).

Robby

On Thu, Nov 10, 2011 at 9:34 AM, Adam Shaw <adamshaw at cs.uchicago.edu> wrote:
> 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
>>
>
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users
>



Posted on the users mailing list.