[plt-scheme] Re: Using PLT Scheme libs elsewhere?

From: Danny Yoo (dyoo at cs.wpi.edu)
Date: Mon May 21 03:49:35 EDT 2007

> Previously, using mzscheme 360, and the scheme implementation of the md5 
> library, the time was almost 6 min.
> real	5m46.574s
> user	1m21.794s
> sys	0m4.231s

I didn't want to guess on this one.  I applied the PLT profiler on this 
program (and including an inlined copy of the md5 library so the profiler 
could look through it.)

The dominating factor here is the 32-bit word arithmetic within the loop 
in step4 of the md5 algorithm.  A good third or so of the total runtime 
appears to be spent doing "word+=!", one of the private functions in the 
module that simulates a 32-bit word arithmetic operation.

So the slowness you're seeing isn't really your code at all: it has more 
to do with the implementation of md5.ss in the standard library.

> The Java version is a bit more verbose, so it spends a bit more 
> printing.  I *guess* that could partially account for why it is slower. 
> (?!)

No, it's not a verbosity issue.  I can easily write a verbose program 
that's dog slow.  *grin* But I don't think people have really stressed the 
standard library's md5.ss in such a way that warranted looking at its 
performance more closely.

You've highlighted that the performance might need to be tuned up a bit, 
so maybe someone can take a look to see if it's possible to make the word 
arithmetic faster.  Still, since you're getting good results with the 
other md5 library binding, maybe you can just stick with that one for now.

Posted on the users mailing list.