[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: m4_defn overhead
Re: m4_defn overhead
Thu, 11 Oct 2007 19:21:07 +0200
* Eric Blake wrote on Thu, Oct 11, 2007 at 01:04:51AM CEST:
> 2007-10-10 Eric Blake <address@hidden>
> Avoid some overhead from m4_defn and m4_popdef.
> * lib/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine): Only
> pass on first argument, since we are documented that way.
> (m4_for, m4_append_uniq, m4_text_wrap): Optimize out defined-ness
> check where it is safe to do so.
> (m4_append): Likewise, and quote the separator.
> (m4_text_box): Likewise, and avoid regex, also be robust to
> expansion and quadrigraphs.
This patch causes a regression with CVS Libtool: its configure script is
unusably botched with this. More specifically, when I revert the hunk
below, things look better, but I haven't analysed this further. I can't
even tell whether it's Libtool to blame (but even if it is, we may want
to be a bit careful anyway). If it's not, then some Autoconf testsuite
addition would seem to be in order.
> diff --git a/lib/m4sugar/m4sugar.m4 b/lib/m4sugar/m4sugar.m4
> index 952794a..85f2c72 100644
> --- a/lib/m4sugar/m4sugar.m4
> +++ b/lib/m4sugar/m4sugar.m4
> @@ -1680,9 +1681,11 @@ m4_defun([m4_join],
> # => act1
> # =>
> # => active
> +# Use m4_builtin to avoid overhead of m4_defn.
> - m4_ifdef([$1], [m4_defn([$1])$3])[$2])])
> + m4_ifdef([$1], [m4_builtin([defn], [$1])[$3]])[$2])])
> # m4_append_uniq(MACRO-NAME, STRING, [SEPARATOR])
- m4_defn overhead, Eric Blake, 2007/10/10
- Re: m4_defn overhead,
Ralf Wildenhues <=
- Re: m4_defn overhead, Eric Blake, 2007/10/11
- Re: m4_defn overhead, Ralf Wildenhues, 2007/10/12
- Re: m4_defn overhead, Eric Blake, 2007/10/12
- Handling of single-quoted comma [was: m4_defn overhead], Eric Blake, 2007/10/15
- Re: Handling of single-quoted comma [was: m4_defn overhead], Ralf Wildenhues, 2007/10/16
- Re: Handling of single-quoted comma [was: m4_defn overhead], Eric Blake, 2007/10/16
- Re: Handling of single-quoted comma [was: m4_defn overhead], Eric Blake, 2007/10/19