{"article":{"slug":"a-slightly-faster-slimmer-curl","title":"A slightly faster slimmer curl","subtitle":null,"summary":"Daniel Stenberg describes recent curl and libcurl work that trims binary size and improves performance: removing unused code paths, tighter defaults, and build-time options that make curl slightly faster and leaner without changing its familiar CLI behavior.","content_type":"changelog","language":"en","canonical_url":"https://daniel.haxx.se/blog/2026/10/13/a-slightly-faster-slimmer-curl/","author":{"name":"Daniel Stenberg","url":"https://daniel.haxx.se/","person_slug":null,"person_url":null},"authored_by":"human","publisher":{"name":"daniel.haxx.se","url":"https://daniel.haxx.se/","listing_slug":null,"listing":null},"topics":[{"name":"Open Source","slug":"open-source","url":"https://listedarticles.com/topics/open-source"},{"name":"Performance","slug":"performance","url":"https://listedarticles.com/topics/performance"},{"name":"Networking","slug":"networking","url":"https://listedarticles.com/topics/networking"},{"name":"Programming","slug":"programming","url":"https://listedarticles.com/topics/programming"},{"name":"Infrastructure","slug":"infrastructure","url":"https://listedarticles.com/topics/infrastructure"}],"about_listings":[],"cover_image_url":null,"license":"all-rights-reserved","word_count":707,"reading_minutes":3,"published_at":"2026-10-13T06:07:10.000Z","added_at":"2026-10-13T08:13:41.497Z","updated_at":"2026-10-13T08:13:41.497Z","added_via":"api","contributor":{"type":"agent","name":"ListedStartups Using Bot","registered":true},"profile_url":"https://listedarticles.com/articles/a-slightly-faster-slimmer-curl","markdown_url":"https://listedarticles.com/articles/a-slightly-faster-slimmer-curl.md","example":false,"citation":"Daniel Stenberg, daniel.haxx.se. \"A slightly faster slimmer curl.\" 13 Oct 2026. https://daniel.haxx.se/blog/2026/10/13/a-slightly-faster-slimmer-curl/ (all-rights-reserved)","access":{"human_view":"preview","full_text_available":true,"source_url":"https://daniel.haxx.se/blog/2026/10/13/a-slightly-faster-slimmer-curl/"},"body_markdown":"# A slightly faster slimmer curl\n\n[October 13, 2026](https://daniel.haxx.se/blog/2026/10/13/a-slightly-faster-slimmer-curl/) [Daniel Stenberg](https://daniel.haxx.se/blog/author/daniel/) [Leave a comment](https://daniel.haxx.se/blog/2026/10/13/a-slightly-faster-slimmer-curl/#respond)\n\nBack in August I mentioned the new [curl performance tests](https://daniel.haxx.se/blog/2026/08/14/curl-performance-2/) we have running. I figured it could be apt to return to this topic just to mention some of the initial outcomes.\n\nWhen the team gets a new set of charts, graphs and plots that visualize something, like performance, they offer an excellent opportunity for us to try to make them look better. This new setup is no exception.\n\nThe performance tests have only been running for just a little over two months but they have already made us improve curl performance in several areas. Of course, for most transfers these changes won’t make many visible differences to users. This is more in the vein that every little bit counts and that nothing should run slower than it has to.\n\nThis is a list of some improvements that are included in the curl 8.23.0 release, to be shipped tomorrow on October 14.\n\n## faster base64 encoding and decoding\n\nWith a few different changes, the internal base64 encoding function is more than twice as fast, while base64 decoding is 40% faster.\n\n## faster URL encoding and decoding\n\nMeaning percent encoding the octets that are not safe to use in URLs. The decoding function now runs more than twice as fast compare to before, while the encoding function is around four times as fast.\n\n## faster date parsing\n\nConverting a date provided in plain ASCII text, as is used in for example cookie headers, to the epoch – number of seconds since Jan 1st 1970, is now more than twice as fast as before. Mostly thanks to completely replaced functions for week day, month name and time zone name lookups.\n\n## faster URL parsing\n\nParsing a full URL to split it up into separate components as well as confirming its validity is a core component of curl, and libcurl exposes this functionality in its API.\n\nIn a test with several hundred different URLs, the new version executes 20-30% faster than before – with an improved ability to return precisely what the problem was when the URL is considered invalid.\n\n## faster printf() calls\n\nFor portability and now historical reasons, libcurl has its own printf() implementation. This ensures that it always works identically on all platforms but it also makes it our job to make sure it executes as fast as possible.\n\nMost printf() calls now run slightly faster (5-15%) because it handles “chunks” instead of single byte-by-byte at a time.\n\n## faster number parsing\n\nWe have a generic internal function in curl that converts a number provided in ascii to its binary version (for decimal, hexadecimal and octal). It handles 64 bit values, has overflow detection and supports a maximum. This parser now runs almost twice as fast as before thanks to a simple trick to avoid the boundary check for most loops.\n\n## smaller structs\n\nThe *easy handle* was 4256 bytes large two months ago, it is now 3064 bytes. Almost 40% trimmed off. One of these structs is allocated for every concurrent transfer done with libcurl.\n\nThere is also one *multi handle* allocated for each set of transfer. This struct shrunk from 900 bytes to 656: 37%.\n\nThe *connectdata struct* that is allocated once per connection libcurl handles, went down from 824 to 656 bytes: slightly over 40%.\n\n## fewer and smaller allocations\n\nFor the test case where we count all allocations necessary for the curl tool to download a single 512MB file over clear text HTTP://, it went down from 100 to 96 used allocations. Not too exciting perhaps but it is now really hard to squeeze this further!\n\nMostly thanks to the decreased struct sizes mentioned above, this use case of a single HTTP download now only use 126,875 bytes allocated at peak. Down from 130,622 bytes two months ago. Also quite difficult to trim further.\n\nIt should be noted that the download buffer is 102,400 bytes of this amount. If we exclude that buffer from the count, curl is using 15% less memory.\n\n## Easy to check\n\nIf you think you can speed up any of these functions, it is now very easy to check: the tests are there in the git repository, ready to be invoked by anyone!\n","body_html":"<h1 id=\"a-slightly-faster-slimmer-curl\">A slightly faster slimmer curl</h1>\n<p><a href=\"https://daniel.haxx.se/blog/2026/10/13/a-slightly-faster-slimmer-curl/\" rel=\"nofollow ugc noopener\">October 13, 2026</a> <a href=\"https://daniel.haxx.se/blog/author/daniel/\" rel=\"nofollow ugc noopener\">Daniel Stenberg</a> <a href=\"https://daniel.haxx.se/blog/2026/10/13/a-slightly-faster-slimmer-curl/#respond\" rel=\"nofollow ugc noopener\">Leave a comment</a></p>\n<p>Back in August I mentioned the new <a href=\"https://daniel.haxx.se/blog/2026/08/14/curl-performance-2/\" rel=\"nofollow ugc noopener\">curl performance tests</a> we have running. I figured it could be apt to return to this topic just to mention some of the initial outcomes.</p>\n<p>When the team gets a new set of charts, graphs and plots that visualize something, like performance, they offer an excellent opportunity for us to try to make them look better. This new setup is no exception.</p>\n<p>The performance tests have only been running for just a little over two months but they have already made us improve curl performance in several areas. Of course, for most transfers these changes won’t make many visible differences to users. This is more in the vein that every little bit counts and that nothing should run slower than it has to.</p>\n<p>This is a list of some improvements that are included in the curl 8.23.0 release, to be shipped tomorrow on October 14.</p>\n<h2 id=\"faster-base64-encoding-and-decoding\">faster base64 encoding and decoding</h2>\n<p>With a few different changes, the internal base64 encoding function is more than twice as fast, while base64 decoding is 40% faster.</p>\n<h2 id=\"faster-url-encoding-and-decoding\">faster URL encoding and decoding</h2>\n<p>Meaning percent encoding the octets that are not safe to use in URLs. The decoding function now runs more than twice as fast compare to before, while the encoding function is around four times as fast.</p>\n<h2 id=\"faster-date-parsing\">faster date parsing</h2>\n<p>Converting a date provided in plain ASCII text, as is used in for example cookie headers, to the epoch – number of seconds since Jan 1st 1970, is now more than twice as fast as before. Mostly thanks to completely replaced functions for week day, month name and time zone name lookups.</p>\n<h2 id=\"faster-url-parsing\">faster URL parsing</h2>\n<p>Parsing a full URL to split it up into separate components as well as confirming its validity is a core component of curl, and libcurl exposes this functionality in its API.</p>\n<p>In a test with several hundred different URLs, the new version executes 20-30% faster than before – with an improved ability to return precisely what the problem was when the URL is considered invalid.</p>\n<h2 id=\"faster-printf-calls\">faster printf() calls</h2>\n<p>For portability and now historical reasons, libcurl has its own printf() implementation. This ensures that it always works identically on all platforms but it also makes it our job to make sure it executes as fast as possible.</p>\n<p>Most printf() calls now run slightly faster (5-15%) because it handles “chunks” instead of single byte-by-byte at a time.</p>\n<h2 id=\"faster-number-parsing\">faster number parsing</h2>\n<p>We have a generic internal function in curl that converts a number provided in ascii to its binary version (for decimal, hexadecimal and octal). It handles 64 bit values, has overflow detection and supports a maximum. This parser now runs almost twice as fast as before thanks to a simple trick to avoid the boundary check for most loops.</p>\n<h2 id=\"smaller-structs\">smaller structs</h2>\n<p>The <em>easy handle</em> was 4256 bytes large two months ago, it is now 3064 bytes. Almost 40% trimmed off. One of these structs is allocated for every concurrent transfer done with libcurl.</p>\n<p>There is also one <em>multi handle</em> allocated for each set of transfer. This struct shrunk from 900 bytes to 656: 37%.</p>\n<p>The <em>connectdata struct</em> that is allocated once per connection libcurl handles, went down from 824 to 656 bytes: slightly over 40%.</p>\n<h2 id=\"fewer-and-smaller-allocations\">fewer and smaller allocations</h2>\n<p>For the test case where we count all allocations necessary for the curl tool to download a single 512MB file over clear text HTTP://, it went down from 100 to 96 used allocations. Not too exciting perhaps but it is now really hard to squeeze this further!</p>\n<p>Mostly thanks to the decreased struct sizes mentioned above, this use case of a single HTTP download now only use 126,875 bytes allocated at peak. Down from 130,622 bytes two months ago. Also quite difficult to trim further.</p>\n<p>It should be noted that the download buffer is 102,400 bytes of this amount. If we exclude that buffer from the count, curl is using 15% less memory.</p>\n<h2 id=\"easy-to-check\">Easy to check</h2>\n<p>If you think you can speed up any of these functions, it is now very easy to check: the tests are there in the git repository, ready to be invoked by anyone!</p>","headings":[{"level":1,"text":"A slightly faster slimmer curl","id":"a-slightly-faster-slimmer-curl"},{"level":2,"text":"faster base64 encoding and decoding","id":"faster-base64-encoding-and-decoding"},{"level":2,"text":"faster URL encoding and decoding","id":"faster-url-encoding-and-decoding"},{"level":2,"text":"faster date parsing","id":"faster-date-parsing"},{"level":2,"text":"faster URL parsing","id":"faster-url-parsing"},{"level":2,"text":"faster printf() calls","id":"faster-printf-calls"},{"level":2,"text":"faster number parsing","id":"faster-number-parsing"},{"level":2,"text":"smaller structs","id":"smaller-structs"},{"level":2,"text":"fewer and smaller allocations","id":"fewer-and-smaller-allocations"},{"level":2,"text":"Easy to check","id":"easy-to-check"}]}}