[plt-scheme] Re: Using PLT Scheme libs elsewhere?
> As for the version of PLT Scheme, I may need some education. I am using
> DrScheme, and the version currently offered for download is 360. Is it
> the case that version 369 of PLT won't work w/DrScheme, or that there's
> a secret handshake required to persuade it? (I haven't found where it
> lives either, but I presume it should be pretty easy to find. (?))
Hi SpinyNorman,
369 is still a prerelease; you can grab it at:
http://pre.plt-scheme.org/installers/
> Second question: For evaluating speedup, I can use the crude eye-hand-
> stopwatch method of course, but I believe there is a library function
> for timing executions; I'm not sure of its name. Clue?
There's a built-in special form called "time". If you go into Help Desk
(Press F1 in DrScheme), and search for the term "time", you should see it
in the documentation. Alternatively, you can look at:
http://download.plt-scheme.org/doc/360/html/mzscheme/mzscheme-Z-H-15.html#node_idx_3424
Here's an example:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> (time (begin (factorial 5000) (void)))
cpu time: 52 real time: 49 gc time: 16
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
where factorial is the silly definition you've probably seen a million
times.
Another way you could pinpoint the hotspot, though, is to use a profiler.
There's an introduction to it here:
http://www.plt-scheme.org/software/drscheme/tour/tour-Z-H-11.html#node_chap_10
In a program that's as direct as yours, I'm pretty sure the dominating
expression is the call to the md5 function, but in general, it's good to
use these tools rather than intuition alone to figure out where the time
is going.
Good luck!