Subject: /usr/bin/openssl is 3-4 times slower than pkgsrc
To: None <current-users@netbsd.org>
From: Atsushi Onoe <onoe@sm.sony.co.jp>
List: current-users
Date: 07/15/2000 12:57:23
I just noticed that openssl (libcrypto) installed as base is about
3-4 times slower than installed via pkgsrc on i386.

Though the versions of openssl differ between two results,
it is probably due to the differences of the compile options.

I'm not sure it is possible to improve performance of base library...

Atsushi Onoe

% ldd /usr/bin/opnssl
/usr/bin/openssl:
	 -lssl.0 => /usr/lib/libssl.so.0
	 -lcrypto.0 => /usr/lib/libcrypto.so.0
	 -lc.12 => /usr/lib/libc.so.12
% /usr/bin/openssl speed des
Doing des cbc for 3s on 8 size blocks: 925275 des cbc's in 3.01s
Doing des cbc for 3s on 64 size blocks: 123697 des cbc's in 3.01s
Doing des cbc for 3s on 256 size blocks: 31221 des cbc's in 3.00s
Doing des cbc for 3s on 1024 size blocks: 7830 des cbc's in 3.01s
Doing des cbc for 3s on 8192 size blocks: 979 des cbc's in 3.01s
Doing des ede3 for 3s on 8 size blocks: 301482 des ede3's in 3.00s
Doing des ede3 for 3s on 64 size blocks: 38465 des ede3's in 3.01s
Doing des ede3 for 3s on 256 size blocks: 9647 des ede3's in 3.00s
Doing des ede3 for 3s on 1024 size blocks: 2413 des ede3's in 3.01s
Doing des ede3 for 3s on 8192 size blocks: 302 des ede3's in 3.01s
OpenSSL 0.9.4 09 Aug 1999
built on: Fri Jul 14 11:37:17 JST 2000
options:bn(32,32) md2(int) rc4(ptr,int) des(ptr,risc1,16,long) idea(int) blowfish(idx) 
compiler: cc -O2  -Werror 
The 'numbers' are in 1000s of bytes per second processed.
type              8 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
des cbc           2459.20k     2630.10k     2664.19k     2663.76k     2664.44k
des ede3           803.95k      817.86k      823.21k      820.90k      821.92k


% ldd /usr/pkg/bin/openssl
/usr/pkg/bin/openssl:
	 -lssl.1 => /usr/pkg/lib/libssl.so.1
	 -lcrypto.1 => /usr/pkg/lib/libcrypto.so.1
	 -lc.12 => /usr/lib/libc.so.12
% /usr/pkg/bin/openssl speed des
Doing des cbc for 3s on 8 size blocks: 3142896 des cbc's in 3.20s
Doing des cbc for 3s on 64 size blocks: 429303 des cbc's in 2.98s
Doing des cbc for 3s on 256 size blocks: 109212 des cbc's in 3.10s
Doing des cbc for 3s on 1024 size blocks: 27508 des cbc's in 3.00s
Doing des cbc for 3s on 8192 size blocks: 3440 des cbc's in 3.10s
Doing des ede3 for 3s on 8 size blocks: 1174150 des ede3's in 3.10s
Doing des ede3 for 3s on 64 size blocks: 154536 des ede3's in 3.00s
Doing des ede3 for 3s on 256 size blocks: 38893 des ede3's in 3.10s
Doing des ede3 for 3s on 1024 size blocks: 9740 des ede3's in 3.00s
Doing des ede3 for 3s on 8192 size blocks: 1218 des ede3's in 3.10s
OpenSSL 0.9.5a 1 Apr 2000
built on: Fri Jul 14 19:57:45 JST 2000
options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(idx) 
compiler: gcc -fPIC -DPIC -DBN_ASM -DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -m486 -Wall -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
The 'numbers' are in 1000s of bytes per second processed.
type              8 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
des cbc           8325.55k     9219.93k     9288.46k     9389.40k     9362.29k
des ede3          3120.66k     3296.77k     3307.84k     3324.59k     3314.90k