curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Fewer mallocs is better, episode #47

From: Daniel Stenberg via curl-library <curl-library_at_lists.haxx.se>
Date: Fri, 28 Jan 2022 15:00:37 +0100 (CET)

On Thu, 27 Jan 2022, Gavin Henry via curl-library wrote:

> Yes, it was strlen. My apologies. They switch to berval types:

For the fun of it I checked curl's use of strlen in a typical invoke like
shown before. "curl -Ls https://google.com/" (which includes a redirect)

Counting all uses with ltrace, also including OpenSSL etc.

It then makes around 686 calls to strlen(). The *total* size was 7826, thus
the average call is for strings less than 12 bytes long. The longest returned
value is 36 (*) The median length is 10.

Conclusion: I'm not seeing a general strlen problem in curl.

(*) = this is the longest SAN name returned in the server cert

-- 
  / daniel.haxx.se
  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
  | https://curl.se/support.html
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2022-01-28