cURL / Mailing Lists / curl-library / Single Mail


Re: curl_global_init performance

From: Daniel Stenberg <>
Date: Thu, 29 Aug 2013 12:32:00 +0200 (CEST)

On Thu, 29 Aug 2013, Tim Ruehsen wrote:

> It looks like that curl_global_init() initalizes OpenSSL though SSL is not
> needed. Kcachegrind show that SSL_load_error_strings() is alone responsible
> for nearly 50% impact.
> Isn't it possible to only initialize SSL stuff when needed ?

Not easily, no.

A major problem for libcurl (but not for wget) is that OpenSSL (and a few
other libs) don't provide thread-safe init functions. We need to make sure
that they are called in a safe way if we want to have the rest of the API work
fine in threads. Our way of making sure is to have curl_global_init().

A can think of other ways of doing it, but I can't think of a way that we can
introduce now without changing API/ABI...

To me, it is sad that such a seemingly mundane function like
SSL_load_error_strings() seems to be the offender here.

List admin:
Received on 2013-08-29