[Pkg-raspi-maintainers] Poor openssl performance on RPI3 debian aarch64

Mathieu Gallissot mathieu.gallissot at gmail.com
Fri Mar 30 16:24:09 UTC 2018


Dear all,
I've been benchmarking openssl in aarch64 using the debian image and I'm
surprised about the poor performance obtained. In the end i've got the
raspian twice faster in 32bits than the 64bit debian.

Here is the test results on raspian 32bits

pi at raspberrypi:~ $ openssl version
OpenSSL 1.1.0f  25 May 2017

pi at raspberrypi:~ $ openssl speed -evp aes-256-cbc
Doing aes-256-cbc for 3s on 16 size blocks: 5462846 aes-256-cbc's in 3.00s
Doing aes-256-cbc for 3s on 64 size blocks: 1778112 aes-256-cbc's in 3.00s
Doing aes-256-cbc for 3s on 256 size blocks: 482197 aes-256-cbc's in 3.00s
Doing aes-256-cbc for 3s on 1024 size blocks: 123167 aes-256-cbc's in 3.00s
Doing aes-256-cbc for 3s on 8192 size blocks: 15496 aes-256-cbc's in 3.00s
Doing aes-256-cbc for 3s on 16384 size blocks: 7754 aes-256-cbc's in 3.00s
OpenSSL 1.1.0f  25 May 2017
built on: reproducible build, date unspecified
options:bn(64,32) rc4(char) des(long) aes(partial) blowfish(ptr)
compiler: gcc -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS
-DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC -DOPENSSL_BN_ASM_MONT
-DOPENSSL_BN_ASM_GF2m -D
                                   SHA1_ASM -DSHA256_ASM -DSHA512_ASM
-DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM
-DOPENSSLDIR="\"/usr/lib/ssl\"" -DENGINESDIR="\"/usr

/lib/arm-linux-gnueabihf/engines-1.1\""
The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes     64 bytes    256 bytes   1024 bytes
8192 bytes  16384 bytes
aes-256-cbc      29135.18k    37933.06k    41147.48k    42041.00k
42314.41k    42347.18k

note : using a 64bits kernel doens't impact much the speed

And here are the same tests results on same hardware, but with an debian
full 64bits image build with raspi3-image-spec

root at rpi3:~# openssl version
OpenSSL 1.1.0g  2 Nov 2017

root at rpi3:~# openssl speed -evp aes-256-cbc
Doing aes-256-cbc for 3s on 16 size blocks: 2648717 aes-256-cbc's in 3.00s
Doing aes-256-cbc for 3s on 64 size blocks: 848118 aes-256-cbc's in 3.00s
Doing aes-256-cbc for 3s on 256 size blocks: 229195 aes-256-cbc's in 3.00s
Doing aes-256-cbc for 3s on 1024 size blocks: 58474 aes-256-cbc's in 3.00s
Doing aes-256-cbc for 3s on 8192 size blocks: 7353 aes-256-cbc's in 3.00s
Doing aes-256-cbc for 3s on 16384 size blocks: 3678 aes-256-cbc's in 3.00s
OpenSSL 1.1.0g  2 Nov 2017
built on: reproducible build, date unspecified
options:bn(64,64) rc4(char) des(int) aes(partial) blowfish(ptr)
compiler: gcc -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS
-DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC -DOPENSSL_BN_ASM_MONT
-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DECP_NISTZ256_ASM
-DPOLY1305_ASM -DOPENSSLDIR="\"/usr/lib/ssl\""
-DENGINESDIR="\"/usr/lib/aarch64-linux-gnu/engines-1.1\""
The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes     64 bytes    256 bytes   1024 bytes
8192 bytes  16384 bytes
aes-256-cbc      14126.49k    18093.18k    19557.97k    19959.13k
20078.59k    20086.78k

I've tried to recompile on the board the package (using apt-get source and
debuild) without luch results. I would expect the 64bit version to be at
least at the same speed.
Any idea on how to increase the openssl speed ?

Best,
Mathieu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-raspi-maintainers/attachments/20180330/c101ba4c/attachment.html>


More information about the Pkg-raspi-maintainers mailing list