From ... From: Erik Naggum Subject: Re: Performance tuning Date: 2000/12/04 Message-ID: <3184953833736032@naggum.net>#1/1 X-Deja-AN: 701121260 References: mail-copies-to: never Content-Type: text/plain; charset=us-ascii X-Complaints-To: newsmaster@eunet.no X-Trace: oslo-nntp.eunet.no 975968221 24088 195.0.192.66 (4 Dec 2000 22:17:01 GMT) Organization: Naggum Software; vox: +47 800 35477; gsm: +47 93 256 360; fax: +47 93 270 868; http://naggum.no; http://naggum.net User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7 Mime-Version: 1.0 NNTP-Posting-Date: 4 Dec 2000 22:17:01 GMT Newsgroups: comp.lang.lisp * Greg Menke | For practice I just implemented a md5 hashing routine, it works but is | quite slow. To make MD5 perform reasonably fast, you need access to machine integers and rotate instructions. MD5 looks like it was designed by someone who wrote in assembler on a machine with more registers than your average Intel, and it hurts to make that perform in Common Lisp. I decided to split the integers in half to get them within fixnum range (the Emacs Lisp implementation has made a similar decision), but also to write directly into a preallocated bignum rather than an array because some critical operations were faster that way. (An annoying "feature" with MD5 is that its operations are all within 32-bit words, so there's very little to be gained from bignum support.) #:Erik -- "When you are having a bad day and it seems like everybody is trying to piss you off, remember that it takes 42 muscles to produce a frown, but only 4 muscles to work the trigger of a good sniper rifle." -- Unknown