[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] use test -s to speed up check for empty file
From: |
Eric Blake |
Subject: |
Re: [PATCH] use test -s to speed up check for empty file |
Date: |
Fri, 05 Oct 2007 13:17:20 -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:56 AM:
> This is the source of run-time performance improvements. It uses
> "test -s" to know if there will be output from diff, and skips the
> invocation if this is not the case. I was surprised too by the
> difference, but it's there to see. I abstracted this into a
> shell function too.
>
>
> +at_diff_devnull () {
Namespace, comments...
> + test -s "$[1]" || return 0
Is 'test -s' portable? autoconf.texi is silent on the matter. Would we
need a fallback? If so, we should calculate it at the same time as we
calculate $at_diff and $at_devnull.
Otherwise, this looks okay.
- --
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
iD8DBQFHBo3A84KuGfSFAYARArn8AKDBpoN+LCUaMrE96l50DfrbdimSjgCfcA9m
BJdFinBgyo8sC9DiHGJLmgk=
=bFhh
-----END PGP SIGNATURE-----