curl-library
Re: curl_global_init performance
Date: Mon, 02 Sep 2013 09:51:55 +0200
On Friday 30 August 2013 23:01:20 Daniel Stenberg wrote:
> On Fri, 30 Aug 2013, Tim Ruehsen wrote:
> > The 'time' command is not very exact, it gives just a direction. I agree,
> > that in normal situations (user starting curl to download one file), a
> > difference of a few milliseconds do not matter at all. But what about
> > scripts, that download small files in a loop in a fast network... e.g.
> > using wget takes 10s while curl would take 50s ?
>
> When thinking further about this subject, it struck me that
> SSL_load_error_strings() isn't mentioned to have any multi-threading
> problems in the man page. It should be possible to move to get done before
> the first use of OpenSSL much more easily than I thought before.
Yesterday evening I posted a mail about using atomics - it look for me as it
did not arrive... I can't send it again before tonight, so in short:
libcurl could use atomics to delay openssl_init. A mutex / lock is not needed.
If atomics are available (e.g. gcc _sync built-in functions or C11 capabale
compiler), use them for delaying ssl init. If not, don't.
This preserves API/ABI and speeds up at least a big part of libcurl
installations (i guess most Unix/Linux distributions having gcc).
Tim
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-09-02