autoconf-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] Add AC_REQUIRE_SHELL_FN


From: Eric Blake
Subject: Re: [PATCH] Add AC_REQUIRE_SHELL_FN
Date: Mon, 20 Oct 2008 16:38:01 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Paolo Bonzini <bonzini <at> gnu.org> writes:

> 
> This adds AC_REQUIRE_SHELL_FN, which places the function in a "late"
> diversion coming after the processing of --help and --version.
> 
>       Add AC_REQUIRE_SHELL_FN and the SHELL_FN diversion.
>       * lib/autoconf/general.m4 (AC_REQUIRE_SHELL_FN): New.
>       (m4_divert(SHELL_FN)): New.

Looks good.  Please apply.

With regards to the 12 patches, I've noticed what I think will be a common way 
to speed up Autoconf across most (if not all) of them:

AC_DEFUN([foo],
[AC_REQUIRE_SHELL_FN([ac_func_foo], [...],
[dnl big
dnl long
dnl definition
...
])dnl
ac_func_foo $1
])

is inherently slower than:

AC_DEFUN([foo_fn],
[AC_REQUIRE_SHELL_FN([ac_func_foo], [...],
[dnl big
dnl long
dnl definition
...
])])

AC_DEFUN([foo],
[AC_REQUIRE([foo_fn])dnl
ac_func_foo $1
])

Why?  Because in the first instance, m4 has to parse the big long string to 
find the appropriate closing ], on every use of the macro, even though it will 
only be expanding the AC_REQUIRE_SHELL_FN once.  In the second instance, the 
AC_REQUIRE line takes much less effort to parse than the full-blown shell 
definition.

Yes, this probably means refactoring your entire series to use this idea, but 
hopefully it proves to make autoconf even faster.

Do you want to push your 12 patches to my mob branch, to make it easier to play 
with them?

-- 
Eric Blake







reply via email to

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