[botan-devel] Botan performance.

Jack Lloyd lloyd at randombit.net
Thu Apr 12 19:18:01 EDT 2012

On Thu, Apr 12, 2012 at 10:44:40PM +0000, Tarik Guelzim wrote:
> I am currently using botan 1.10.1 in a projet and i have noticed a slight
> performance hit ( on average x3) compared to some other implementation. Are
> there any tips to make the ops run faster. I am using DES1/3
> Mac 9.19 and RSA in a series of encrypt decrypt sign verify mac and keypair
> gen operation.

I would be interested in understanding this. A 3x slowdown is huge!

It doesn't seem to be the primitives. Taking OpenSSL 1.0.1 as an
average case, and comparing with botan 1.10.1 on Linux (GCC 4.6,
i7-860), DES in botan seems comptetitve, perhaps slightly faster but
it's difficult to say (the difference is small enough to be noise),
and RSA is no more than 10% slower than OpenSSL (with 1024 bit keys),
and faster with 4096 bit keys. The X9.19 MAC code is not particularly
optimized, but it runs to within 5% of the basic DES ECB.

However if RSA keypair generation is in your critical path, this could
be a problem. There has been little effort in making that faster, and
I would be interested to see if your slowdown is as noticable with key
generation removed from the comparison.

One possibility that strikes me is that you're comparing botan using
32 bit limbs against another implementation using 64 bit limbs. That
would produce about a 3-4x slowdown in RSA (assuming you're using a 64
bit processor). You can check this in the configure output, there will
be a line like

   INFO: Using MP module mp_x86_64

Beyond that, I'd need to know more details about your system (CPU and
compiler, especially), how you configure botan, more about your exact
work pattern, and what implementation you're comparing with.


More information about the botan-devel mailing list