hi all
I found mbedtls SSL handshake is slower than openssl。
mbedtls : at least 50 ms
OpenSSL: usually less than 5 ms
there is a report created by uftrace . Is this because I didn’t turn on hardware acceleration.
Any advice is greatly appreciated!
Total time Self time Calls Function
========== ========== ========== ====================
1.045 m 55.000 us 1 <402b00>
1.045 m 1.044 m 1 uloop_run_timeout
962.150 ms 29.400 us 35 <7f80234b70>
962.121 ms 136.320 us 35 <7f80234a44>
961.980 ms 2.258 ms 1059 mbedtls_ssl_handshake_server_step
936.198 ms 70.760 us 52 <7f80234870>
936.121 ms 61.200 us 51 <7f80235188>
936.056 ms 96.920 us 51 mbedtls_ssl_handshake
935.959 ms 117.120 us 178 mbedtls_ssl_handshake_step
601.615 ms 5.331 ms 191 mbedtls_ecp_set_zero
515.225 ms 12.160 us 37 mbedtls_pk_get_type
515.215 ms 1.920 us 1 mbedtls_pk_sign
515.213 ms 1.120 us 1 mbedtls_pk_sign_restartable
515.210 ms 1.240 us 1 mbedtls_rsa_pkcs1_sign
515.209 ms 13.480 us 1 mbedtls_rsa_rsassa_pkcs1_v15_sign
511.813 ms 25.120 us 1 mbedtls_rsa_private
439.797 ms 187.255 ms 54500 mbedtls_mpi_cmp_abs
424.161 ms 1.441 ms 4 mbedtls_mpi_exp_mod
400.945 ms 4.480 us 2 mbedtls_ecp_mul_restartable
396.134 ms 45.362 ms 9669 mbedtls_ecdsa_from_keypair
299.945 ms 299.945 ms 489700 mbedtls_base64_decode
211.966 ms 3.240 us 1 mbedtls_ecdh_make_params
211.953 ms 1.520 us 1 mbedtls_ecdh_gen_public
189.037 ms 2.840 us 1 mbedtls_ecdh_calc_secret
189.032 ms 3.440 us 1 mbedtls_ecdh_compute_shared
147.827 ms 82.650 ms 10069 mbedtls_mpi_mul_mpi
141.072 ms 77.594 ms 31714 mbedtls_mpi_sub_abs
137.863 ms 18.215 ms 7 mbedtls_mpi_inv_mod
97.748 ms 18.373 ms 17631 mbedtls_mpi_sub_mpi
47.805 ms 16.709 ms 8 mbedtls_mpi_gcd
45.655 ms 2.704 ms 4284 mbedtls_cipher_auth_decrypt
44.607 ms 282.400 us 170 mbedtls_gcm_crypt_and_tag
42.952 ms 77.680 us 17 <7f8018d344>
42.635 ms 2.873 ms 17 <7f8018c9e8>
41.904 ms 4.034 ms 170 mbedtls_gcm_update
41.203 ms 577.640 us 173 mbedtls_ssl_write_record
40.038 ms 92.080 us 119 <7f80234804>
39.946 ms 100.080 us 119 <7f80235288>
39.846 ms 85.000 us 119 mbedtls_ssl_write
39.761 ms 173.240 us 119 mbedtls_ssl_close_notify
38.303 ms 21.000 us 17 <405124>
38.282 ms 238.760 us 17 <404fe8>
38.160 ms 6.010 ms 6378 mbedtls_mpi_add_mpi
37.805 ms 2.536 ms 4046 mbedtls_cipher_update
35.865 ms 101.000 us 136 mbedtls_cipher_auth_encrypt
35.010 ms 1.217 ms 17 ustream_vprintf
32.903 ms 2.383 ms 4046 mbedtls_aes_crypt_ecb
30.519 ms 22.330 ms 4046 mbedtls_internal_aes_encrypt
28.559 ms 24.837 ms 57395 mbedtls_mpi_free
25.405 ms 738.120 us 68 <404ad4>
23.603 ms 6.572 ms 544 <404568>
22.480 ms 15.980 ms 24971 mbedtls_mpi_copy
20.486 ms 19.997 ms 56616 mbedtls_mpi_grow