[ccan] [PATCH] Add C program to generate inter-depends and test-depends more quickly.

Joseph Adams joeyadams3.14159 at gmail.com
Wed Mar 9 18:09:53 EST 2011


Building CCAN in Cygwin is quite sluggish compared to in Linux, but
generating inter-depends and test-depends stand out as a major
bottleneck.  On my system, inter-depends takes about 55 seconds, and
test-depends takes about 20 seconds.

I found out why.  In Cygwin, spawning subshells appears to be
unusually slow.  For instance, if I run the following in Cygwin:

    for i in {1..10} ; do echo $(echo $i); done

I can watch it counting, and it takes about half a second.  A similar
effect can be observed on Linux, but you have to change that 10 to
about 1000.

The attached patch adds tools/gen_inter_test_depends.c , a program to
generate both inter-depends and test-depends.  On Ubuntu 10.10 and
Cygwin, the inter-depends and test-depends files produced were
identical to their script-generated counterparts.

Note that gen_inter_test_depends.c includes <ccan/darray/darray.h> and
<ccan/str/str.h>, but only uses macros and inline functions from each,
meaning it does not need the respective .o files.  Also, I don't know
all the ins and outs of how CCAN builds, so please check my work in
the Makefile and move things around as necessary.


Thanks!
- Joey Adams
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-C-program-to-generate-inter-depends-and-test-dep.patch
Type: application/octet-stream
Size: 6832 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/ccan/attachments/20110308/11392972/attachment.obj>


More information about the ccan mailing list