#69 closed defect (wontfix)

explore optimizing startup costs of sha256 to be as cheap as hashlib

Reported by: zooko Owned by:
Priority: major Milestone:
Version: 0.5.19 Keywords:
Cc: warner-tahoe@…, warner Launchpad Bug:

Description

Brian did some benchmarks which suggest that, although Crypto++'s implementation of sha256 is slightly faster (around 5%) than OpenSSL's on his Macbook Pro, it has significantly higher start-up time (around 14 μs vs 2.5 μs):

http://tahoe-lafs.org/pipermail/tahoe-dev/2010-August/004948.html

The startup overhead might be due to something in pycryptopp rather than in Crypto++ proper. To close this ticket, figure out if pycryptopp is doing something when instantiating a sha256 object that takes longer than what hashlib does.

(Note: last time I checked, Crypto++ fell back to its pure C++ implementation on Mac OS X instead of using its optimized assembly version, since Mac OS X doesn't support Intel asm syntax, since it uses an ancient version of gas — "v1.38" which was apparently forked from upstream gas before time began. I suspect Apple won't upgrade to modern gas because they are allergic to GPLv3, so there is no obvious solution to this performance limitation. If someone wants to reproduce Brian's benchmark on a non-Mac-OS-X machine it would be interesting to see if Crypto++'s sha256 is faster on non-Mac-OS-X.)

Change History (1)

comment:1 Changed at 2016-01-03T23:10:13Z by zooko

  • Cc changed from warner-tahoe@lothar.com,warner to warner-tahoe@lothar.com, warner
  • Resolution set to wontfix
  • Status changed from new to closed

We're just going to recommend hashlib's implementation of SHA256.

Note: See TracTickets for help on using tickets.