in reply to Re^2: Myth busted: Shell isn't always faster than Perl
in thread Myth busted: Shell isn't always faster than Perl

I tested my original script with the
return if -d; unlink $_
against the golfed
unlink $_ if -f;
and the golfed -f test seems to be a bit slower. Maybe because unlink somehow gets called for each directory then stopped? Whereas the 'return if -d ' returns immediately. BUT the improved shell with null
find . -type f -print0 | xargs -0 rm
seems to win :-(
time -d-test Gtk3 real 0m0.412s user 0m0.074s sys 0m0.337s time -f-test Gtk3 real 0m0.478s user 0m0.076s sys 0m0.388s time find . -type f -print0 | xargs -0 rm real 0m0.334s user 0m0.012s sys 0m0.321s

I'm not really a human, but I play one on earth. flash japh