Nick Glencross <[EMAIL PROTECTED]> wrote: > Still some way off the OS md5sum, which is typically 0.15 seconds, about > 12x quicker. That may sound quite a bit, but much of it can probably be > accounted for by inefficiencies in my conversion to parrot code (a > slightly awkward rol, and perhaps the manipulation of the arrays).
A new opcode C<rol> would certainly help, yes. It would replace 4 instructions (each roughly executed once per char) with one instruction. A JITted C<rol> opcode should give a speed up of one forth - which is a lot. Another problem is that MD5.imc doesn't process the file blockwise. md5sum.imc first slurps the whole file into a string then it's converted to a word array and in a third step it's processed. The influence of this gets worse with bigger files. > Contrary to what I keep being told by Java programmers, you'll never > going to be as fast as optimised C code, let's face it. There are always some optimizations still. > Regards, > Nick leo