From 4e407ac0b74ec2f444702b61425120dbaed3a60d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 17 Sep 2026 13:10:46 +0200 Subject: [PATCH] scan: add dateparser data --- describe-tests.conf | 7 +++++++ scan.pl | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/describe-tests.conf b/describe-tests.conf index 61895ef..a7b18e4 100644 --- a/describe-tests.conf +++ b/describe-tests.conf @@ -215,3 +215,10 @@ This test repeatedly formats a commonly used simple message with `curl_msnprintf()`: literal text plus `%s`, a `size_t` and a `curl_off_t`, with no width or precision. Where `snprintf` measures an elaborate format, this measures the common one. + +[dateparser] + +This test has a list of 180+ different strings holding specific timestamps. +They include both valid and invalid dates. The test parses each such timestamp +100,000 times each. The result is the average time in nanoseconds the date +parser function curl_getdate() took across all invocations. diff --git a/scan.pl b/scan.pl index 600ddd0..22fb545 100755 --- a/scan.pl +++ b/scan.pl @@ -940,6 +940,9 @@ sub single { elsif(/^urlparser: Time\/URL: ([0-9.]+) ns/) { $urlparser{$scan} = $1; } + elsif(/^dateparser: Time\/date: ([0-9.]+) ns/) { + $dateparser{$scan} = $1; + } elsif(/^snprintf: Time\/loop: ([0-9.]+) ns/) { $snprintf{$scan} = $1; } @@ -1352,6 +1355,10 @@ sub single { "lower", "urldecode", "nanoseconds", %urldec) if %urldec; +push @output, show("date parsing", + "lower", + "dateparser", + "nanoseconds", %dateparser) if %dateparser; printf "
%u data-points\n", scalar(%alltests);