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: Cristian Rodríguez via curl-library <curl-library_at_lists.haxx.se>
Date: Fri, 4 Feb 2022 08:00:38 -0300

On Thu, Feb 3, 2022 at 10:09 PM Henrik Holst via curl-library
<curl-library_at_lists.haxx.se> wrote:

> 23% of those for curl.se and 8% for google.com is due to Curl_compareheader, this looks like an internal only function and every single use inside curl is using string literals so we can replace them all with a compile time sizeof, if patches for this would be accepted then I would be happy to provide such.

Well.. add a size_t header_len and content_len parameter to
Curl_compareheader .. or provide an inline version of it, any compiler
from the last decade will then do constant folding on strlen("test")
when optimization is enabled.
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2022-02-04