[Toybox] md5sum cleanup

Ivo van Poorten ivopvp at gmail.com
Thu May 15 09:50:54 PDT 2014


On Wed, 14 May 2014 21:56:13 -0700 Daniel Verkamp <daniel at drv.nu> wrote:
> Here's a quick cleanup of md5sum. Executive summary: smaller and
> faster.

Nice! It got me excited to see if I could get it faster.

Times in seconds on my machine (IA32 Sempron 1.66MHz):

cur-hg      8.6
daniel      6.7
ivo         4.9
md5sum      2.8
openssl     2.7

I removed the conditionals out of the inner loop, introduced another
LUT, made the LUTs align.

bloatcheck:

-----------------------------------------------------------------------
 intab                                           0       256        256
 md5rot                                          0       256        256
 md5_transform                                 366       365         -1
-----------------------------------------------------------------------
                                                                    511

The tables can be downsized to 64 bytes, but it'll make it a bit
slower, especially on architectures where non-aligned reads are slower.

The patch is relative to current hg and includes Daniel's changes.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: md5sum-ivo.patch
Type: text/x-diff
Size: 3292 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20140515/0db42b06/attachment-0002.patch>


More information about the Toybox mailing list