Simon Josefsson wrote: > Running "gnulib-tool --import" has become slow: > > [EMAIL PROTECTED]:~/src/gnutls$ time gnulib-tool --import > ... > real 0m47.043s > user 0m19.559s > sys 0m10.299s > [EMAIL PROTECTED]:~/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. Bruno _______________________________________________ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib