[gambit-list] Profiling compiled Gambit Scheme code

James Long longster at gmail.com
Thu Feb 18 14:12:45 EST 2010


On Thu, Feb 18, 2010 at 12:52 PM, Marc Feeley <feeley at iro.umontreal.ca> wrote:

> My guess is that Mac OS X has a broken implementation of setitimer.  I've send bug reports to Apple but never heard from them.  Bug report attached below.

Hrmph.  This might be the case.  How did you fix it on OSX, or is it
fixed?  statprof seems to run fine for executables on my OSX (10.6).
Do you use real timers?  Can I compile it the same with for my iPhone?

Here was my test.  Did I do this right?  This is all running on the iPhone.

(##thread-heartbeat-interval-set! (exact->inexact 1/1000))
(##interrupt-vector-set!
 1
 (let ((count 0)
       (time (real-time)))
   (lambda ()
     (##thread-heartbeat!)
     (set! count (+ count 1))

     (let ((diff (- (real-time) time)))
       (if (> diff 1.)
           (begin
             (pp (list diff count))
             (set! count 0)
             (set! time (real-time))))))))

Output:

(1.0214531421661377 29)
(1.0321640968322754 29)
(1.0493919849395752 25)
(1.0320019721984863 26)
(1.0321731567382812 25)
(1.0144340991973877 24)
(1.0476930141448975 20)
(1.0140950679779053 20)

I was expecting the output to be closer to (1.001 1000).



More information about the Gambit-list mailing list