On 04/11/2010 03:31 AM, Jim Meyering wrote: > This patch does something I've wanted for a while. > It prints the elapsed time for each individual syntax-check rule. > > I don't particularly like the fact that each new rule > - uses a temporary .sc-start-* file in which it saves each start time > - uses awk to compute the difference of two floating point numbers > > Initially I used "bc" to compute the difference, but that was overkill. > The way I'm using awk isn't pretty, especially considering that > most modern shells can do "$[end - start]", but it works.
$[] is not portable; $(()) is the POSIX-preferred variant that even more shells support. And we already make a lot of assumptions in maint.mk that maintainers have a POSIX shell (that is, I seriously doubt that Solaris /bin/sh would work with maint.mk), in part because we are also guaranteed that GNU make is running if maint.mk is even in use. I haven't looked closely at the patch yet, for possible improvements, but I am pleased with the idea of listing elapsed times (it will probably show up even more on cygwin to help expose places where reducing the number of forks makes sense). -- Eric Blake [email protected] +1-801-349-2682 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
