quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Quilt-dev] [patch 3/8] tac is not portable


From: Jean Delvare
Subject: Re: [Quilt-dev] [patch 3/8] tac is not portable
Date: Thu, 15 Sep 2005 13:15:17 +0200 (CEST)

Hi Gary,

[Gary V. Vaughan]
> > The perl equivalent is about 3 times slower than tac for me, so I don't
> > think it is a good idea to just replace it for everyone. Same holds for
> > all other compatibility problems BTW, fixing them should preferably not
> > cause significant slowdowns for other users.
>
> :-)) LOL
>
> Are you kidding me?

Absolutely not.

> For a file that has maybe 50 lines worst case

50 lines worst case? *You* must be kidding me now. My series file is
frequently nearing 100 patches, and Andrew Morton's is more like 500.

> $ head -n 50 /var/log/httpd/access_log > input
> $ time sh -c "cat input | perl -e 'print reverse <>'
> real    0m0.025s
> user    0m0.005s
> sys     0m0.017s
>
> $ time sh -c "head -n 50 /var/log/httpd/access_log | gtac"
> real    0m0.026s
> user    0m0.005s
> sys     0m0.017s

You're not comparing the same test case, and you are bringing "sh"
into the picture needlessly. Please compare:

  time head -n 500 <largefile> | perl -e 'print reverse <>'

with:

  time head -n 500 <largefile> | gtac

This will be a more valid test.

> The timings are completely overwhelmed by the speed of the rest of the
> pipeline!

This is hardly a reason not to consider the speed difference, providing
we can evaluate it. My tests this morning, on a 650 MHz Pentium III, was
about 0.070s against 0.025s for tac. This makes a difference. You may
object that 0.045s isn't really important, but this is added by
changing only one part of the whole command. The compatibility issues we
are trying to address these days are likely to require us to change more
commands. If we do not care about performance, the cumulated changes are
likely to make quilt slower than it was, and I would like to avoid that.

Please keep in mind that not everyone uses fast machines. My laptop runs
at 650 MHz, my workstation (day job) runs at 500 MHz. I want quilt to be
reaonably fast on these systems.

> For the sake of easy maintenance of the code, I'd take a hit of even
> an extra second of processing time. 1/1000th of a second hardly seems
> worth arguing over.

There are other valid approaches. I would prefer that the tac
substitution is made at "build" time, just like we do for other
commands. Or we can provide a standalone tac script (your perl
one-liner) and copy it where quilt is installed if no tac binary if
found at configure time, as was discussed yesterday. Both solutions are
just fine as far as maintenance is concerned, and do not imply slowdowns
for other users.

Another point to consider is that quilt is currently usable without perl.
No major command needs it as far as I can see. Some users may find it
valuable. Bringing in more perl into quilt is even questionable, as
quilt is supposed to be shell-based. If you want something totally
portable, perl is obviously the way to go, but you better rewrite quilt
entierly in perl then.

--
Jean Delvare




reply via email to

[Prev in Thread] Current Thread [Next in Thread]