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.

a strlen update

From: Daniel Stenberg via curl-library <>
Date: Thu, 10 Feb 2022 09:27:01 +0100 (CET)


In a previous mail here [1], I counted strlens done by curl. This then
triggered some work, mostly by Henrik Holst, to update code to not use
strlen() unnecessarily when it can avoid it.

I did a quick follow-up count today. I don't recall the exact build options I
used the last time, so I rebuilt 7.81.0 and current git master with the same
set now and ran a comparison:

  ltrace ./src/curl -Ls -o /dev/null 2>&1 | grep strlen

In 7.81.0 this made 596 to 600 strlen() calls.

In git master, this now makes 390 to 392 calls. A 33% reduction.

(This used OpenSSL/1.1.1m and speaks HTTP/2 and as said before,
makes a redirect)

[1] =

  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
Received on 2022-02-10