Re: [PATCH] Use perl instead of tac

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jörg
Date: Monday, April 28, 2008 - 8:15 am

Hallo Randal,

Randal L. Schwartz <merlyn@stonehenge.com> wrote:

Nothing. My intention was not the speed, but the dependency on Perl. But
your are right. Except from the point that my suggestion is broken, it's
*much* slower:

% time dash -c 'while IFS= read -r line; do rev="$line
$rev"; done; printf "%s" "$rev"' < gitk-git/gitk-wish DN
dash -c  < gitk-git/gitk-wish > /dev/null 2> /dev/null  17,89s user 2,68s system 96% cpu 21,352 total

% time tac < gitk-git/gitk-wish DN
tac < gitk-git/gitk-wish > /dev/null 2> /dev/null  0,01s user 0,01s system 91% cpu 0,017 total

% time perl -e 'print reverse <>' < gitk-git/gitk-wish DN
perl -e 'print reverse <>' < gitk-git/gitk-wish > /dev/null 2> /dev/null  0,07s user 0,01s system 59% cpu 0,141 total

But I doubt this hurts, because we don't have such a big input.

% wc -l git.c
390 git.c

% time dash -c 'while IFS= read -r line; do rev="$line
$rev"; done; printf "%s" "$rev"' < git.c DN
dash -c  < git.c > /dev/null 2> /dev/null  0,04s user 0,04s system 62% cpu 0,115 total

And what about something like this: 'tac || rev || perl …'

Bye, Jörg.
-- 
Was der Bauer nicht kennt, das frisst er nicht. Würde der Städter kennen,
was er frisst, er würde umgehend Bauer werden.
                                                       Oliver Hassencamp
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] Use perl instead of tac, Jörg, (Mon Apr 28, 8:15 am)
Re: [PATCH] Use perl instead of tac, Avery Pennarun, (Mon Apr 28, 10:26 am)
Re: [PATCH] Use perl instead of tac, Matthieu Moy, (Mon Apr 28, 10:34 am)
Re: [PATCH] Use perl instead of tac, Brian Gernhardt, (Mon Apr 28, 10:50 am)
Re: [PATCH] Use perl instead of tac, Brian Gernhardt, (Mon Apr 28, 12:13 pm)
Re: [PATCH] Use perl instead of tac, Jörg, (Wed Apr 30, 2:02 am)
Re: [PATCH] Use perl instead of tac, Jörg, (Wed Apr 30, 2:39 am)
Re: [PATCH] Use perl instead of tac, Brian Gernhardt, (Wed Apr 30, 8:25 am)
Re: [PATCH] Use perl instead of tac, Brian Gernhardt, (Wed Apr 30, 9:12 am)
Re: [PATCH] Use perl instead of tac, Jörg, (Sun May 4, 3:13 pm)
Re: [PATCH] Use perl instead of tac, Brian Gernhardt, (Mon May 5, 9:32 pm)