[gambit-list] Profiling compiled Gambit Scheme code

James Long longster at gmail.com
Wed Feb 17 18:37:35 EST 2010


Hey guys,

I'm working on profiling some compiled Gambit Scheme code.  I just
wrote a quick article on some of my first attempts:

http://jlongster.com/blog/2010/02/17/profiling-gambit/

My question is: what are some best practices?  So far, I've compiled
my code with "-track-scheme" and "-debug-location".  Neither of those
help real profilers, but it should help statprof.

First, I tried using real profilers like Shark and Instruments.  It
worked out pretty good, but is there anything I can do to tell Gambit
to compile my code in an orderly way and to do as little rearranging?

Second, I tried statprof. It's great.  I was able to get some decent
output in my compiled program.  I pumped up the thread heartbeat to
1/1000 instead of 1/100.  However, strangely enough, when I tried
running it straight on my iPhone, I got only ONE entry, the high-level
function which runs everything, and of course it said 100%.

I know statprof uses Gambit's internal function for tracking location.
 How do they work?  If I've compiled in "-debug-location" my compiled
code, even on the iPhone, should be able to keep track of itself,
shouldn't it?

(For those interested, I wrote a little server library which
implements "remote files" so that statprof can connect to my computer
from my iPhone and tell it to write all the HTML files.)

Also, are there are declarations that will make a difference?  My code
is being compiled with "(block)", does that mean a lot of things will
be collapsed together?

- James



More information about the Gambit-list mailing list