openssl performance delta built-in vs custom compiled

Sam Bull sam.hacking at
Tue Dec 16 15:31:59 UTC 2014

On ven, 2014-12-12 at 23:53 +0100, Marcus Pollice wrote:
> I'd be grateful if someone could point out the reason for the difference 
> and also how to compile binaries to achieve the same performance.

I know nothing about openssl in particular, but you may see improvements
simply due to the flags you have used to compile it.

The binaries shipped in Ubuntu must meet the lowest common denominator,
that is they can't use any processor specific optimisations, otherwise
the binaries would not run on all computers.

For example, on my Gentoo machine everything is compiled for my specific
processor model, meaning it uses various SSE and other processor
specific instructions.

There are also optimisations that may not be enabled on the Ubuntu
builds for various reasons. For example, I use -fomit-frame-pointer
which provides optimisations, but is probably not used in Ubuntu as
debugging an application compiled this way is extremely difficult.

Another is setting the optimisation level to 3 (-O3), this again would
make it faster, but will cause some programs to malfunction, and
developers typically don't allow bug reports if you've used this level.

You can read more about the most common options here:

If you want to have everything optimised to your system, you may want to
consider using Gentoo, you can set the flags you want to use when
compiling, then whenever you install a program (akin to apt-get install)
it will download the source and compile it to your specification.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <>

More information about the Ubuntu-devel-discuss mailing list