[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] use indirect dispatch instead of m4_case
From: |
Eric Blake |
Subject: |
Re: [PATCH] use indirect dispatch instead of m4_case |
Date: |
Fri, 05 Oct 2007 13:21:36 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Paolo Bonzini on 10/5/2007 1:57 AM:
> Just as an experiment, I tried replacing m4_case with indirect dispatch
> in _AT_CHECK. It *is* faster by about 10%.
>
>
> +# AT_DIFF_STDERR/AT_DIFF_STDOUT
> +# -----------------------------
> +# These are subroutines of AT_CHECK. Using indirect dispatch is a tad
> +# faster than using m4_case, and these are called very frequently.
> +m4_define([AT_DIFF_STDERR(stderr)], [echo stderr:; tee stderr <"$at_stderr"])
> +m4_define([AT_DIFF_STDERR(ignore)], [echo stderr:; cat "$at_stderr"])
> +m4_define([AT_DIFF_STDERR(experr)], [$at_diff experr "$at_stderr" ||
> at_failed=:])
> +m4_define([AT_DIFF_STDERR()], [at_diff_devnull "$at_stderr" ||
> at_failed=:])
> +m4_define([AT_DIFF_STDOUT(stdout)], [echo stdout:; tee stdout <"$at_stdout"])
> +m4_define([AT_DIFF_STDOUT(ignore)], [echo stdout:; cat "$at_stdout"])
> +m4_define([AT_DIFF_STDOUT(expout)], [$at_diff expout "$at_stdout" ||
> at_failed=:])
> +m4_define([AT_DIFF_STDOUT()], [at_diff_devnull "$at_stdout" ||
> at_failed=:])
Wrap at 80 columns, please - I'd just fold the definition of each
sub-dispatch onto the next line.
> +m4_ifdef([AT_DIFF_STDERR($4)], [m4_indir([AT_DIFF_STDERR($4)])],
> + [echo >>"$at_stderr";
> AS_ECHO(["m4_ifval([$7],[AS_ESCAPE([$4])],[$4])"]) | $at_diff - "$at_stderr"
> || at_failed=:])
Here, you didn't add the long line, but it would be nice to wrap this, too.
Please apply.
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHBo7A84KuGfSFAYARAns4AJ9RO9LvgkPNjGzN1CWJTs4biZGEuwCgpKF1
lCdtjg5jc63zmDeo5joy028=
=PXGv
-----END PGP SIGNATURE-----