Reg slowness seen in openssl 1.1.1

ramakrushna mishra rama.krushna7 at gmail.com
Thu May 9 15:05:51 UTC 2019


Hi,

Thank you for the response.
If we compare in quantify attached is the results.

Thanks and Regards,
Ram Krushna

On Thu, May 9, 2019 at 8:28 PM Salz, Rich <rsalz at akamai.com> wrote:

> I would start with doing profiling on old and new versions to see where
> the slowdown is.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20190509/8d417fe2/attachment-0001.html>
-------------- next part --------------
Differences between:
program rx (pid 6113) collected on PentiumIII (2599 MHz) by Quantify version 7.4 150915 and
program rx (pid 98772) collected on PentiumIII (2599 MHz) by Quantify version 7.4 150915.
                   Function name	 Calls     Cycles % change
+                 ERR_STATE_free	     0          0
+           EVP_camellia_128_ctr	     0          0
+                  EVP_cast5_ecb	     0          0
+                EVP_cast5_cfb64	     0          0
+          ossl_init_thread_stop	     0          0
+      lh_OBJ_NAME_get_down_load	     0          0
+                  EVP_cast5_ofb	     0          0
+                  doall_util_fn	     0          0
+        sk_EX_CALLBACK_pop_free	     0          0
+                      utrcdInit	     0          0
+           RAND_DRBG_secure_new	     0          0
+                  rand_pool_new	     0          0
+      lh_OBJ_NAME_set_down_load	     0          0
+ ossl_init_load_crypto_nodelete	     0          0
+               EVP_aria_256_ccm	     0          0
+                  pam_allow_val	     0          0
+              lh_OBJ_NAME_error	     0          0
+     ossl_init_get_thread_local	     0          0
+         openssl_lh_strcasehash	     0          0
+    rand_pool_entropy_available	     0          0
+              aesni_ecb_encrypt	     0          0
+                 EVP_sha512_256	     0          0
+            close_random_device	     0          0
+                   do_rand_init	     0          0
+                  RAND_DRBG_set	     0          0
+                otmGetDigestCtx	     0          0
+ ossl_store_destroy_loaders_int	     0          0
+                   o_names_init	     0          0
+           __strcasecmp_l_sse42	     0          0
+        do_rand_drbg_init_ossl_	     0          0
+                          fstat	     0          0
+                    module_free	     0          0
+                 ctr_BCC_update	     0          0
+           EVP_camellia_128_ofb	     0          0
+                        ctr_XOR	     0          0
+               lh_OBJ_NAME_free	     0          0
+                 syscall_random	     0          0
+                    EVP_sm4_ofb	     0          0
+      ossl_init_add_all_ciphers	     0          0
+                 EVP_sm4_cfb128	     0          0
+                         expand	     0          0
+                   pthread_self	     0          0
+        CRYPTO_secure_allocated	     0          0
+                       contract	     0          0
+            rand_pool_add_begin	     0          0
+              rand_pool_add_end	     0          0
+             EVP_CIPHER_CTX_new	     0          0
+               EVP_aria_192_ofb	     0          0
+              EVP_aria_128_cfb1	     0          0
+                 rand_pool_init	     0          0
+             sk_nid_triple_free	     0          0
+           EVP_camellia_256_ctr	     0          0
+              EVP_aria_256_cfb1	     0          0
+                         getgid	     0          0
+              EVP_aria_256_cfb8	     0          0
+        ossl_init_engine_rdrand	     0          0
+            check_random_device	     0          0
+            do_err_strings_init	     0          0
+            do_engine_lock_init	     0          0
+           EVP_camellia_128_cbc	     0          0
+             do_rand_init_ossl_	     0          0
+               int_cleanup_item	     0          0
+         OPENSSL_sk_new_reserve	     0          0
+                 get_time_stamp	     0          0
+      EVP_CIPHER_CTX_key_length	     0          0
+ sk_ENGINE_CLEANUP_ITEM_new_null	     0          0
+          EVP_camellia_192_cfb8	     0          0
+               aesni_ecb_cipher	     0          0
+         lh_ERR_STRING_DATA_new	     0          0
+                        getegid	     0          0
+               EVP_aria_192_gcm	     0          0
+                 RAND_DRBG_free	     0          0
+                        init256	     0          0
+               EVP_CipherUpdate	     0          0
+           EVP_camellia_256_cbc	     0          0
+               EVP_aria_128_ctr	     0          0
+                     ctr_update	     0          0
+            EVP_aria_192_cfb128	     0          0
+                   EVP_shake256	     0          0
+                do_ex_data_init	     0          0
+                engine_list_add	     0          0
+           EVP_camellia_256_ecb	     0          0
+            sk_CONF_MODULE_push	     0          0
+              pam_digest_update	     0          0
+            sk_CONF_IMODULE_num	     0          0
+            conf_add_ssl_module	     0          0
+         sk_nid_triple_pop_free	     0          0
+ fmclear_tmp_longchar_or_memptr	     0          0
+        EVP_camellia_192_cfb128	     0          0
+            rand_drbg_get_nonce	     0          0
+      ossl_init_add_all_digests	     0          0
+                    SHA256_Init	     0          0
+          sk_CONF_MODULE_delete	     0          0
+               EVP_aria_256_ecb	     0          0
+               EVP_aria_256_cbc	     0          0
+             lh_OBJ_NAME_delete	     0          0
+ ENGINE_register_pkey_asn1_meths	     0          0
+                    EVP_sm4_cbc	     0          0
+                otm_digestCount	     0          0
+       ossl_init_engine_dynamic	     0          0
+             sk_EX_CALLBACK_num	     0          0
+ unknown_static_function[aesni-x86_64.o/36]	     0          0
+                     sk_reserve	     0          0
+                  rand_pool_add	     0          0
+                        inc_128	     0          0
+               EVP_aria_192_ecb	     0          0
+                    EVP_sm4_ecb	     0          0
+ unknown_static_function[aesni-x86_64.o/35]	     0          0
+          EVP_camellia_128_cfb1	     0          0
+              do_rand_drbg_init	     0          0
+               pam_digest_final	     0          0
+           sk_CONF_MODULE_value	     0          0
+              EVP_aria_192_cfb8	     0          0
+            EVP_CIPHER_CTX_free	     0          0
+ EVP_CIPHER_CTX_get_cipher_data	     0          0
+                 ctr_BCC_blocks	     0          0
+ unknown_static_function[aesni-x86_64.o/34]	     0          0
+                  EVP_cast5_cbc	     0          0
+         ossl_store_cleanup_int	     0          0
+               EVP_CIPHER_flags	     0          0
+          build_SYS_str_reasons	     0          0
+           EVP_camellia_192_ecb	     0          0
+                   BIO_snprintf	     0          0
+                         ctr_df	     0          0
+            open_random_devices	     0          0
+                      update256	     0          0
+      EVP_CIPHER_CTX_test_flags	     0          0
+      EVP_CIPHER_CTX_encrypting	     0          0
+ ossl_init_load_crypto_nodelete_ossl_	     0          0
+        sk_EVP_PBE_CTL_pop_free	     0          0
+              EVP_CipherInit_ex	     0          0
+                 rand_drbg_lock	     0          0
+                     drbg_setup	     0          0
+        EVP_camellia_128_cfb128	     0          0
+                          getrn	     0          0
+                   ctr_BCC_init	     0          0
+           lh_OBJ_NAME_retrieve	     0          0
+      CRYPTO_secure_malloc_done	     0          0
+        sk_CONF_MODULE_new_null	     0          0
+                    err_do_init	     0          0
+                   ossl_tolower	     0          0
+                internal_delete	     0          0
+                   sk_void_free	     0          0
+              rand_pool_entropy	     0          0
+         rand_pool_bytes_needed	     0          0
+           EVP_camellia_128_ecb	     0          0
+   CRYPTO_THREAD_get_current_id	     0          0
+ sk_ENGINE_CLEANUP_ITEM_pop_free	     0          0
+          pam_digest_ctx_create	     0          0
+      rand_drbg_cleanup_entropy	     0          0
+            EVP_aria_128_cfb128	     0          0
+          RAND_DRBG_instantiate	     0          0
+           EVP_CIPHER_CTX_reset	     0          0
+                  BIO_vsnprintf	     0          0
+              rand_pool_cleanup	     0          0
+             engine_list_remove	     0          0
+             sk_CONF_MODULE_num	     0          0
+         ERR_load_strings_const	     0          0
+                 ossl_init_base	     0          0
+                        EVP_sm3	     0          0
+                   EVP_sha3_384	     0          0
+               EVP_aria_192_ctr	     0          0
+               otm_digestString	     0          0
+                       final256	     0          0
+               EVP_aria_128_ofb	     0          0
+                OPENSSL_strnlen	     0          0
+              OPENSSL_issetugid	     0          0
+       rand_drbg_enable_locking	     0          0
+                   EVP_shake128	     0          0
+                    EVP_sm4_ctr	     0          0
+             o_names_init_ossl_	     0          0
+                   EVP_sha3_224	     0          0
+       rand_pool_entropy_needed	     0          0
+                          _dopr	     0          0
+      lh_OSSL_STORE_LOADER_free	     0          0
+                lh_OBJ_NAME_new	     0          0
+           CRYPTO_secure_zalloc	     0          0
+          EVP_camellia_256_cfb1	     0          0
+                   get_and_lock	     0          0
+                pam_digest_init	     0          0
+              int_cleanup_check	     0          0
+           EVP_camellia_256_ofb	     0          0
+           EVP_camellia_192_ctr	     0          0
+               err_load_strings	     0          0
+               rand_pool_buffer	     0          0
+                         fmtstr	     0          0
+               EVP_aria_192_ccm	     0          0
+        EVP_camellia_256_cfb128	     0          0
+           sk_CONF_IMODULE_free	     0          0
+          EVP_camellia_256_cfb8	     0          0
+       rand_pool_add_nonce_data	     0          0
+      rand_pool_acquire_entropy	     0          0
+               EVP_aria_128_cbc	     0          0
+         drbg_ctr_uninstantiate	     0          0
+              EVP_aria_192_cfb1	     0          0
+          EVP_camellia_128_cfb8	     0          0
+               EVP_aria_128_ecb	     0          0
+       ENGINE_get_cipher_engine	     0          0
+                 engine_dynamic	     0          0
+          pam_digest_ctx_delete	     0          0
+                      err_patch	     0          0
+      EVP_CIPHER_CTX_block_size	     0          0
+            evp_app_cleanup_int	     0          0
+           drbg_ctr_instantiate	     0          0
+  ossl_init_load_crypto_strings	     0          0
+                 aesni_init_key	     0          0
+               ossl_ctype_check	     0          0
+              utFreeCommandLine	     0          0
+                  drbg_ctr_init	     0          0
+               EVP_aria_256_ctr	     0          0
+              EVP_aria_128_cfb8	     0          0
+                 compute_growth	     0          0
+            sk_CONF_MODULE_free	     0          0
+                 rand_pool_free	     0          0
+          rand_drbg_cleanup_int	     0          0
+                   EVP_sha3_256	     0          0
+              rand_drbg_restart	     0          0
+             __strcasecmp_sse42	     0          0
+          EVP_camellia_192_cfb1	     0          0
+            EVP_aria_256_cfb128	     0          0
+                       drbg_add	     0          0
+                  ctr_BCC_final	     0          0
+       CRYPTO_secure_clear_free	     0          0
+               rand_pool_detach	     0          0
+          EVP_CIPHER_CTX_cipher	     0          0
+                   EVP_sha3_512	     0          0
+       is_partially_overlapping	     0          0
+               EVP_aria_128_ccm	     0          0
+              lh_OBJ_NAME_doall	     0          0
+                        sh_done	     0          0
+               EVP_aria_256_ofb	     0          0
+               rand_drbg_unlock	     0          0
+              EVP_EncryptUpdate	     0          0
+          rand_drbg_get_entropy	     0          0
+                   SHA256_Final	     0          0
+                 EVP_sha512_224	     0          0
+                drbg_ctr_reseed	     0          0
+           EVP_camellia_192_ofb	     0          0
+               EVP_aria_128_gcm	     0          0
+           EVP_camellia_192_cbc	     0          0
+              get_random_device	     0          0
+               rand_pool_length	     0          0
+             lh_OBJ_NAME_insert	     0          0
+        lh_ERR_STRING_DATA_free	     0          0
+    ERR_load_OSSL_STORE_strings	     0          0
+    sk_ENGINE_CLEANUP_ITEM_push	     0          0
+               def_destroy_data	     0          0
+                    doapr_outch	     0          0
+                      drbg_seed	     0          0
+    lh_ERR_STRING_DATA_retrieve	     0          0
+         sk_NAME_FUNCS_pop_free	     0          0
+                  rand_drbg_new	     0          0
+      lh_ERR_STRING_DATA_insert	     0          0
+          RAND_DRBG_get0_master	     0          0
+          aesni_set_encrypt_key	     0          0
+                  ctr_BCC_block	     0          0
+               RAND_DRBG_reseed	     0          0
+               EVP_aria_256_gcm	     0          0
+                  SHA256_Update	     0          0
+               EVP_aria_192_cbc	     0          0
+        rand_drbg_cleanup_nonce	     0          0
+             cryptDigestCtxSize	   900       1800
+             cryptOEAlgSpecSize	   900       1800
+       cryptServiceCallbackSize	   900       1800
+            crypt_stub_mem_free	   900       3600
+               init[m_sha1.o/0]	   400       4400
+                cryptDigestInit	   900       4500
+                init[m_md5.o/0]	   500       5500
+              final[m_sha1.o/2]	   400       6000
+          pthread_mutex_destroy	   900       7200
+               final[m_md5.o/2]	   500       7500
+             update[m_sha1.o/1]	   600       9600
+            cryptServiceDestroy	   900       9900
+              update[m_md5.o/1]	   700      11200
+          cryptDigestCtxCleanup	   900      11700
+             cryptDynLockDelete	   900      12600
+                cryptDestructor	   900      14400
+         cryptOEAlgSpecProperty	  1800      23400
+              cryptServiceNewEx	   900      25200
+             cryptDigestCtxInit	   900      26100
+              cryptDigestUpdate	  1300      33800
+              cryptDigestInitEx	   900      39600
+               cryptDigestFinal	   900      45600
+             cryptCtxErrorClear	  4900      58800
+                 pam_mac_digest	   900     109800
+           cryptDigestGetByName	   900     182300
!    sha1_block_data_order_ssse3	  -413    -246535  34.16% faster
!            OPENSSL_LH_retrieve	 -1201     -74489 100.00% faster
!            fmSecGenerateDigest	  -300     -70204  81.25% faster
!       md5_block_asm_data_order	  -200     -58600  16.67% faster
!                OPENSSL_cleanse	 -1216     -47097  25.47% faster
!                        memmove	 -1200     -46200 100.00% faster
!                   OBJ_NAME_get	 -1200     -25200 100.00% faster
!          _wordcopy_fwd_aligned	 -1200     -22800 100.00% faster
!                  obj_name_hash	 -1200     -21600 100.00% faster
!                   obj_name_cmp	 -1200     -15600 100.00% faster
!           EVP_get_digestbyname	 -1200      -9600 100.00% faster
!                  ENGINE_finish	  -608      -8488  32.04% faster
!            engine_table_select	  -307      -5505  30.41% faster
!         EVP_MD_CTX_clear_flags	  -307      -2477  18.66% faster
!                 fmESHA1_DIGEST	     0      -1200  20.00% faster
!          pthread_rwlock_unlock	    -9       -174 100.00% faster
!          pthread_rwlock_wrlock	    -8       -160 100.00% faster
!               ENGINE_get_first	    -2        -52 100.00% faster
!              CRYPTO_atomic_add	    -2        -46 100.00% faster
!           CRYPTO_THREAD_unlock	    -9        -45 100.00% faster
!                ENGINE_get_next	    -2        -44 100.00% faster
!       CRYPTO_THREAD_write_lock	    -8        -40 100.00% faster
!               engine_free_util	    -2        -28 100.00% faster
!          ERR_func_error_string	    -1        -20 100.00% faster
!          pthread_rwlock_rdlock	    -1        -20 100.00% faster
!               int_err_get_item	    -1        -19 100.00% faster
!    ENGINE_register_all_digests	    -1        -15 100.00% faster
!    ENGINE_register_all_ciphers	    -1        -15 100.00% faster
!                       EVP_sha1	    -7        -14 100.00% faster
!                      RAND_seed	    -1        -13 100.00% faster
!           err_string_data_hash	    -1        -12 100.00% faster
!        ENGINE_register_digests	    -1         -7 100.00% faster
!        ENGINE_register_ciphers	    -1         -7 100.00% faster
!        ERR_load_CRYPTO_strings	    -1         -6 100.00% faster
!           RAND_get_rand_method	    -1         -6 100.00% faster
!        CRYPTO_THREAD_read_lock	    -1         -5 100.00% faster
! __close_nocancel[libpthread.so.0/182]	    -1         -4 100.00% faster
!            err_string_data_cmp	    -1         -4 100.00% faster
! __read_nocancel[libpthread.so.0/180]	    -1         -4 100.00% faster
! __open_nocancel[libpthread.so.0/206]	    -1         -4 100.00% faster
!      read[libpthread.so.0/179]	    -1         -2 100.00% faster
!                    ENGINE_free	    -2         -2 100.00% faster
!     close[libpthread.so.0/181]	    -1         -2 100.00% faster
!    open64[libpthread.so.0/205]	    -1         -2 100.00% faster
!                  alloc_perturb	    15         60 187.50% slower
!                      SHA1_Init	  -207        109   1.38% slower
!              EVP_PKEY_CTX_free	  -301        894  12.41% slower
!                       MD5_Init	  -100       1200  15.38% slower
!            cryptServiceCtxSize	   900       1800 ------% slower
!                         memcpy	   366       1937   6.46% slower
!                    SHA1_Update	  -328       1983   5.57% slower
!                    __GI_memset	    -9       3247   4.91% slower
!              CRYPTO_clear_free	  -301       3284  17.09% slower
!                 EVP_MD_CTX_new	  -301       3898 162.28% slower
!                EVP_MD_CTX_free	  -301       4494  62.36% slower
!          crypt_stub_mem_malloc	   900       4500 ------% slower
!                  CRYPTO_zalloc	  -602       5370  14.90% slower
!            __ctype_toupper_loc	   900       5400 ------% slower
!             EVP_DigestFinal_ex	  -307       5483  14.20% slower
!       ENGINE_get_digest_engine	  -307       6586 272.83% slower
!              EVP_DigestInit_ex	  -307       7550  12.05% slower
!             EVP_MD_CTX_md_data	 -1142       8974  70.52% slower
!                 __strlen_sse42	   900       9000 ------% slower
!                     MD5_Update	  -200       9800  28.41% slower
!               EVP_MD_CTX_reset	  -301      12561  26.82% slower
!          EVP_MD_CTX_test_flags	   599      14397 399.58% slower
!               cryptConstructor	   900      16200 ------% slower
!             pthread_mutex_init	   900      18900 ------% slower
!                        ut_free	  2700      18900 ------% slower
!               EVP_DigestUpdate	  -528      19744 540.04% slower
!             cryptDynLockCreate	   900      19800 ------% slower
!                    CRYPTO_free	  -602      20390 169.78% slower
!                          cfree	  2998      23984 124.81% slower
!                  CRYPTO_malloc	  -602      28186 167.63% slower
!                   pthread_once	  8594      34376 712.60% slower
!               cryptInitService	   900      38700 ------% slower
!                      ut_malloc	  2700      40500 ------% slower
!        CRYPTO_THREAD_get_local	  4900      49000 ------% slower
!                     SHA1_Final	  -207      68506 268.71% slower
!            pthread_getspecific	  4900      68600 ------% slower
!                      MD5_Final	  -100      82500 392.86% slower
!                  ERR_get_state	  4900     102900 ------% slower
!                         malloc	  2998     119920 124.81% slower
!         CRYPTO_THREAD_run_once	  8594     131170 2175.29% slower
!                    _int_malloc	  2998     134885 121.25% slower
!                      _int_free	  2998     186192 143.55% slower
!            OPENSSL_init_crypto	  3698     193038 518.06% slower
!                ERR_clear_error	  4900    5434100 ------% slower
-        do_rand_lock_init_ossl_	     0          0
-                 OPENSSL_sk_new	     0          0
-               ERR_load_strings	     0          0
-                   RAND_OpenSSL	     0          0
-                   rand_cleanup	     0          0
-                      rand_seed	    -1         -2
-               fmSecLoadLibrary	    -1        -17
-            fmsecCall_RAND_Seed	    -1        -18
-                       rand_add	    -1      -2188
-                init[m_md5.o/3]	  -600      -2400
-              init[m_sha1.o/15]	  -607      -2428
-               final[m_md5.o/1]	  -600      -3600
-             final[m_sha1.o/14]	  -607      -3642
-              update[m_md5.o/2]	  -900      -9000
-            update[m_sha1.o/13]	  -928      -9280
-             OPENSSL_LH_strhash	 -1200     -54000
390 differences; 6878176 Cycles (0.003 secs at 2599 MHz) 262.37% slower overall (including system calls).


More information about the openssl-users mailing list