[Top][All Lists]

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

Re: [bug-gnulib] gnulib-tool --import slowness

From: Bruno Haible
Subject: Re: [bug-gnulib] gnulib-tool --import slowness
Date: Fri, 2 Sep 2005 19:11:26 +0200
User-agent: KMail/1.5

Simon Josefsson wrote:
> Running "gnulib-tool --import" has become slow:
> address@hidden:~/src/gnutls$ time gnulib-tool --import
> ...
> real    0m47.043s
> user    0m19.559s
> sys     0m10.299s
> address@hidden:~/src/gnutls$
> This is on GnuTLS, which uses:
> gl_MODULES([error getline getpass memmem memmove minmax readline snprintf])
> It appears to be calling sed 10-15 times for every imported files.

But "top" doesn't show these sed processes; it shows the gnulib-tool
script itself eating the time. I guess the problem is the double loop
over the new file and the old files. This is quadratic in the number of
files. I'll change this to use "join" and "sort" instead of a double loop.

> Can't we use
> perl -pi -e 's/foo/bar' *.c
> or something else instead?

Using perl instead of sed to gain speed? Nice joke :-)

Besides that, I never use perl, because
  - perl's syntax is so complex that it's nearly impossible to understand
    a program just by reading its source code,
  - the perl developers don't care much about backward compatibility, as
    you can see from the Unicode changes between perl 5.4 - 5.6 - 5.8;
    therefore you must be prepared to rewrite your scripts every two or
    three years.
Stick to /bin/sh instead.


reply via email to

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