See below for results from my recent tests. Clearly there's some difference in OpenSSL performance, but has anyone seen any improvements in real life use?
Tested with trunk r33210. Flash space usage was ~15% higher with -O3 than with -Os. Between tests entire source tree was deleted and recompiled from scratch to ensure compiler flags were used and no old binaries were mixed in.
system type : Atheros AR7241 rev 1
machine : TP-LINK TL-MR3220
processor : 0
cpu model : MIPS 24Kc V7.4
BogoMIPS : 265.42
CPU frequency : 400 MHz
Baseline: -Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves (OpenWrt default)
Test 1: -O3 -pipe -march=24kc -mtune=24kc -fno-caller-saves
Test 2: -Os -pipe -march=24kc -mtune=24kc -fno-caller-saves
Test 3: Base system built with: -O3 -pipe -march=24kc -mtune=24kc -fno-caller-saves
OpenSSL, zlib, Strongswan: -Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves
OpenSSL benchmark:
MD5 SHA1 SHA256 SHA512 DES 3DES AES128 AES192 AES256 RSAsign RSAvrfy DSAsign DSAvrfy
Baseline | 1.0.1c | 21565440 | 6903470 | 4688820 | 2866180 | 2922150 | 1043180 | 4944900 | 4292270 | 3793580 | 3.6 | 122.2 | 12.3 | 10.0 |
Test 1 | 1.0.1c | 20801880 | 7393690 | 5376000 | 2405720 | 3456000 | 1242790 | 5537110 | 4813480 | 4258820 | 4.4 | 154.0 | 15.4 | 12.7 |
vs. baseline -3,5% +7,1% +14,6% -16,1% +18,3% +19,1% +12,0% +12,1% +12,3% +22,2% +26,0% +25,2% +27,0%
Test 2 | 1.0.1c | 21723870 | 6949550 | 4764330 | 2896550 | 3103400 | 1107630 | 5391020 | 4696750 | 4161190 | 4.4 | 152.9 | 15.3 | 12.6 |
vs. baseline +0,7% +0,7% +1,6% +1,1% +6,2% +6,2% +9,0% +9,4% +9,7% +22,2% +25,1% +24,4% +26,0%
Test 3 | 1.0.1c | 21845330 | 6928380 | 4676270 | 2876100 | 2921470 | 1039700 | 4945920 | 4288510 | 3793580 | 3.6 | 122.4 | 12.2 | 10.0 |
vs. baseline +1,3% +0,4% -0,3% +0,3% 0% -0,3% 0% -0,1% 0% 0% +0,2% -0,8% 0%
Network tests: (wget http://remote-server/100M -O /dev/null)
Strongswan IPSEC (ike:aes256-sha1-modp1536, esp:aes128-sha1):
Baseline: 2,3MB/s
Test 1: 2,3MB/s
Test 2: 2,3MB/s
Test 3: 2,3MB/s
Strongswan IPSEC (ike:aes256-sha1-modp1536, esp:null-null):
Baseline: 9,1MB/s
Test 1: 9,1MB/s
Test 2: 9,1MB/s
Test 3: 9,1MB/s
Between same hosts just L3 routed, no nat, no ipsec
Baseline: 9,1MB/s
Test 1: 9,1MB/s
Test 2: 9,1MB/s
Test 3: 9,1MB/s
There was no difference in numbers if wget was executed on OpenWrt router or on PC behind it.
Strongswan tests used built-in crypto libs. Router didn't have enough flash to install both openssl and strongswan.
Tests performed with snapshots from downloads.openwrt.org on 680MHz AR7161 resulted 3,5MB/s with Strongswan AES128-SHA1. Performance was identical regardless what underlying crypto lib was used.
Attempts to use kernel ciphers (af-alg) with Strongswan resulted incorrectly encrypted packets. This works on i386 PC so something seems to be broken with kernel crypto or Strongswan on OpenWrt. Not sure if this affects other applications utilizing kernel ciphers on OpenWrt.
(Last edited by jr on 18 Aug 2012, 23:32)