Skip to content

Instantly share code, notes, and snippets.

View bagder's full-sized avatar
⌨️
mostly typos

Daniel Stenberg bagder

⌨️
mostly typos
View GitHub Profile
@bagder
bagder / dump.txt
Created April 16, 2025 08:57
valgrind --leak-check=full ./src/curl cloudflare.com
==450632==
==450632== HEAP SUMMARY:
==450632== in use at exit: 13,496 bytes in 331 blocks
==450632== total heap usage: 5,306 allocs, 4,975 frees, 581,992 bytes allocated
==450632==
==450632== 24 bytes in 1 blocks are definitely lost in loss record 12 of 81
==450632== at 0x4844818: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==450632== by 0x153E93: curl_dbg_malloc (memdebug.c:145)
==450632== by 0x174753: Curl_memdup (strdup.c:93)
==450632== by 0x1E7CD9: Curl_httpsrr_set (httpsrr.c:103)
@bagder
bagder / randdisable.pl
Last active April 3, 2025 09:42
Script that generates and run a curl configure with a random set of --disable options
#!/usr/bin/env perl
# Copyright (C) Daniel Stenberg, <[email protected]>, et al.
#
# SPDX-License-Identifier: curl
#
# 1. Figure out all existing configure --disable-* options
# 2. Generate random command line using supported options
# 3. Run configure (exit if problem)
# 4. run "b" to build (exit if problem)
# 5. sleep a second
@bagder
bagder / url.patch
Created March 7, 2025 08:23
lame memleak fix
diff --git a/lib/url.c b/lib/url.c
index 3b1ce3568..9f4716ed0 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -3337,10 +3337,13 @@ static void reuse_conn(struct Curl_easy *data,
temp->hostname_resolve = NULL;
/* reuse init */
existing->bits.reuse = TRUE; /* yes, we are reusing here */
@bagder
bagder / speedstr.c
Last active February 18, 2025 13:01
Test program to measure number parsing performance
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) Daniel Stenberg, <[email protected]>, et al.
*
* This software is licensed as described in the file COPYING, which
@bagder
bagder / git-h2-upload.c
Created September 13, 2024 08:22
Reproducing curl issue #14892
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <errno.h>
/* curl stuff */
#include <curl/curl.h>
#include <curl/mprintf.h>
@bagder
bagder / test.md
Last active July 4, 2024 09:25
PR #14098 perf test comparison
python3 tests/http/scorecard.py --httpd --caddy -d --download=100mb h1

master

Downloads
  Server       Size  single(1x1) [cpu/rss]         serial(50x1) [cpu/rss]         parallel(50x50) [cpu/rss]                Errors       
  httpd       100MB    1239 MB/s [89.0%/14MB]         1414 MB/s [88.5%/14MB]         1781 MB/s [100.2%/18MB]              -          
  caddy       100MB    2007 MB/s [74.2%/14MB]         2573 MB/s [82.8%/15MB]         3425 MB/s [100.3%/18MB]              -          
@bagder
bagder / scorecard.md
Created December 7, 2023 12:09
perf-testing #12468

icing-cw-part5+h2

scoring h2
TLS Handshake
  curl.se...ipv4...ipv6...ok.
  google.com...ipv4...ipv6...ok.
  cloudflare.com...ipv4...ipv6...ok.
  nghttp2.org...ipv4...ipv6...ok.
httpd downloads
@bagder
bagder / compare.md
Last active December 24, 2024 17:09
URL parsers compared. libcurl vs ada
@bagder
bagder / speedada.cpp
Last active November 17, 2023 15:55
measure ada URL parsing the same way speedparse does
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) Daniel Stenberg, <[email protected]>, et al.
*
* This software is licensed as described in the file COPYING, which
@bagder
bagder / speedparse.c
Created November 17, 2023 14:58
measure libcurl URL parsing speed
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) Daniel Stenberg, <[email protected]>, et al.
*
* This software is licensed as described in the file COPYING, which