
这算逆优化么
结果:
arch -arm64e openssl speed -evp aes-256-gcm
LibreSSL 2.8.3 built on: date not available options:bn(64,64) rc4(ptr,int) des(idx,cisc,16,int) aes(partial) blowfish(idx) compiler: information not available The 'numbers' are in 1000s of bytes per second processed. type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes aes-256-gcm 143582.05k 146068.54k 143675.00k 143172.47k 143065.32k arch -x86_64 openssl speed -evp aes-256-gcm
LibreSSL 2.8.3 built on: date not available options:bn(64,64) rc4(16x,int) des(idx,cisc,16,int) aes(partial) blowfish(idx) compiler: information not available The 'numbers' are in 1000s of bytes per second processed. type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes aes-256-gcm 513189.06k 1466338.36k 1692859.34k 1656888.24k 1660308.10k OpenSSL 1.1.1n 15 Mar 2022 built on: Tue Mar 15 14:37:47 2022 UTC options:bn(64,64) rc4(int) des(int) aes(partial) idea(int) blowfish(ptr) compiler: clang -fPIC -arch arm64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -D_REENTRANT -DNDEBUG 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-gcm 1001410.93k 2674462.35k 4020612.61k 4051648.47k 3813676.37k 3968878.79k 重新用 OpenSSL 跑了下,好像自带的 LibreSSL 有点问题
原生情况下跑了 AES 128 GCM,这128和256差距也太大了吧
arch -arm64e openssl speed -evp aes-128-gcm -multi 10
LibreSSL 2.8.3 built on: date not available options:bn(64,64) rc4(ptr,int) des(idx,cisc,16,int) aes(partial) blowfish(idx) compiler: information not available evp 17771871.76k 71601419.60k 287914482.61k 1148759522.20k 9167217710.93k arch -arm64e openssl speed -evp aes-128-gcm
LibreSSL 2.8.3 built on: date not available options:bn(64,64) rc4(ptr,int) des(idx,cisc,16,int) aes(partial) blowfish(idx) compiler: information not available The 'numbers' are in 1000s of bytes per second processed. type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes aes-128-gcm 2219882.36k 8934119.25k 35553156.84k 142883225.35k 1141059247.03k 1 xtinput 2022-04-19 15:37:42 +08:00 我的 M1Max 和你这个数据差不多 |
2 keyfunc OP ``` OpenSSL 1.1.1n 15 Mar 2022 built on: Tue Mar 15 14:37:47 2022 UTC options:bn(64,64) rc4(int) des(int) aes(partial) idea(int) blowfish(ptr) compiler: clang -fPIC -arch arm64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -D_REENTRANT -DNDEBUG 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-gcm 1001410.93k 2674462.35k 4020612.61k 4051648.47k 3813676.37k 3968878.79k ``` 重新用 OpenSSL 跑了下,好像自带的 LibreSSL 有点问题 |
3 linusyang 2022-04-19 16:32:13 +08:00 via iPhone LibreSSL 没有 arm64 的汇编优化,只有 x86_64 的。OpenSSL 的指令集优化多一点。 |
4 xtinput 2022-04-19 16:48:55 +08:00 version: 3.0.2 built on: Tue Mar 15 14:30:24 2022 UTC options: bn(64,64) compiler: clang -fPIC -arch arm64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -D_REENTRANT -DOPENSSL_BUILDING_OPENSSL -DNDEBUG CPUINFO: OPENSSL_armcap=0x7f 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-GCM 933194.39k 2587635.29k 4097587.80k 4664237.94k 5703328.13k 5812055.75k |
5 linusyang 2022-04-19 16:58:46 +08:00 via iPhone 另外可以用自带的试试 aes-128-gcm ,貌似有优化。 |
6 MrKrabs 2022-04-19 16:59:35 +08:00 早说过了没人信 t/841402#reply7 |
7 keyfunc OP @linusyang 是的,好像 128 很快,原生比 rosetta 快了,差距并不大 LibreSSL rosetta aes-128-gcm 1531638.85k 5946102.75k 23789147.19k 95029256.18k 760820812.43k LibreSSL 原生 aes-128-gcm 2220132.69k 8950815.61k 35738367.40k 143223969.26k 1145713507.08k OpenSSL aes-128-gcm 1129241.01k 3110185.88k 4705038.08k 4669664.39k 4536124.82k |