Performance tuning for the XO
Mitch Bradley
wmb at laptop.org
Sat Sep 22 03:35:02 EDT 2007
C. Scott Ananian wrote:
> We make currently make heavy use of hashing in our upgrade &
> verification infrastructure. I'd like to find the fastest possible
> implementation of the SHA-256 and/or RIPEMD-160 algorithms. Can
> anyone offer me advice on the proper compilation options and
> strategies for maximum performance on the processor in the XO? I
> don't see the -mxo option to gcc yet.
> --scott
>
Some timing for libtomcrypt with various compilation options. All times
are for hashing 1MiB of data from memory, timed under Open Firmware with
interrupts disabled.
Hash
-DLTC_SMALL_CODE, -Os
large code, -Os
large code, -O2
sha256
249 mS
202 mS
189 mS
sha512
373 mS
347 mS
358 mS
rmd160
111 mS
112 mS
112 mS
-DLTC_SMALL_CODE causes rolled (as opposed to unrolled) loops in
sha256.c and sha512.c, but is not used in rmd160.c
The code size for the bios_hash binary is about 20K with rolled loops,
about 44K with unrolled loops.
So, with this code, the slow version does sha256 at about 4 MiB/sec, the
fast version does sha256 at about 5.3 MiB/sec, and rm160 goes at 9
MiB/sec in all cases.
More information about the Devel
mailing list