Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Apr 2000 09:37:44 +1000
From:      Peter Jeremy <peter.jeremy@alcatel.com.au>
To:        "Matthew N. Dodd" <winter@jurai.net>
Cc:        Kris Kennaway <kris@FreeBSD.ORG>, current@FreeBSD.ORG
Subject:   Re: OpenSSL asm optimizations
Message-ID:  <00Apr28.093744est.115313@border.alcanet.com.au>
In-Reply-To: <Pine.BSF.4.21.0004220033140.50194-100000@sasami.jurai.net>; from winter@jurai.net on Sat, Apr 22, 2000 at 02:35:51PM %2B1000
References:  <Pine.BSF.4.21.0004211923001.68716-200000@freefall.freebsd.org> <Pine.BSF.4.21.0004220033140.50194-100000@sasami.jurai.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 21 Apr 2000, Kris Kennaway wrote:
> OpenSSL includes asm code for several platforms to speed up various
> operations. Currently we don't build any of this - the attached patch
> turns on asm code for Pentiums and above (it relies on an uncommitted
> patch to sys.mk which defined MACHINE_CPU ?= i386). Set MACHINE_CPU to
> "i586" or "i686" (both are actually identical at present) and rebuild.

On Sat, Apr 22, 2000 at 02:35:51PM +1000, Matthew N. Dodd wrote:
>Can these be turned on at runtime?

Not the way the libraries are currently structured.  There are a
number of libraries where we would get significant speedups by
supporting target-dependent code.  I can think of three possible
ways of supporting this:
1) Use machine-depend shared libraries to replace functions in the
   standard shared libraries.  This approach is used on Solaris -
   the rtld automatically loads a machine-specific library (if it
   exists) before libc.so.  The disadvantages are:
   - no support for static executables or in-line functions
   - slower startup due to the extra libraries (particularly if
     Kris's idea of an ordered list of machine architectures)
   - increased VM usage due to multiple function versions in
     the process address space
   - I'm not sure how difficult it would be to integrate into
     FreeBSD's lazy binding scheme
2) Use indirect function calls, with run-time initialisation to
   setup the pointers.  This approach is used in the kernel for
   bzero/bcopy.  The disadvantages are:
   - no support for in-line functions
   - need to invoke a library initialisation routine (not too
     difficult with ELF)
   - increased function call overheads (indirect rather than
     direct calls).
   - increased VM usage due to multiple function versions in
     the process address space
3) Have separate library versions for each target.
   - Significant increase in disk space occupied by libraries

All the approaches increase the build time since multiple copies
of functions need to be built.

Peter


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?00Apr28.093744est.115313>