From b7435be12332a32cbc485dcfa1d5507729e6d283 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 19 Aug 2020 22:49:11 +0100 Subject: [PATCH] Revert "expire-iso8601: Use date(1)" It's not faster. With DateTime::Format::Strptime, whole program runtime on my test case: real 0m1.371s user 0m1.254s sys 0m0.117s With date(1): real 0m5.408s user 0m1.834s sys 0m3.683s This reverts commit 2d3da03e893d0c59e236224f049215fab8e81e8e. Signed-off-by: Ian Jackson --- scripts/expire-iso8601 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/expire-iso8601 b/scripts/expire-iso8601 index 1ef843b..552b258 100755 --- a/scripts/expire-iso8601 +++ b/scripts/expire-iso8601 @@ -71,18 +71,18 @@ sub scan () { (?: [-+] \d{1,2} \:? \d\d )? )? /x) { print STDERR "ignoring $f\n"; } -# my @t = Date::Parse::strptime($f); -# @t = map { $_ // 0 } @t; -# my $t = mktime @t; + my @t = Date::Parse::strptime($f); + @t = map { $_ // 0 } @t; + my $t = mktime @t; # m # my $t = $strp->parse_datetime($f); # $t = $t->epoch(); # my @t = Date::Parse::strptime($f); #print STDERR Dumper(\@t); # my $t = mktime(@t); - $!=0; $?=0; my $t = `date -d '$&' +%s`; - die "date(!) failed on $&: $? $!" if $! || $?; - chomp $t or confess; +# $!=0; $?=0; my $t = `date -d '$&' +%s`; +# die "date(!) failed on $&: $? $!" if $! || $?; +# chomp $t or confess; push @files, { F => $f, T => $t, U => [] }; } } -- 2.30.2