graph-depends: optimize execution speed
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Wed, 2 Jan 2013 07:08:50 +0000 (07:08 +0000)
committerPeter Korsgaard <jacmet@sunsite.dk>
Wed, 2 Jan 2013 17:58:24 +0000 (18:58 +0100)
commit4359685e145798f06d88eb2e5ba5979ba5de882e
treee3e9d7b8023f6f84c00e1e23d63f503cfc76068c
parent41af66ef393754381778ade4228fef7f1ed3cf52
graph-depends: optimize execution speed

Until now, graph-depends was calling "make <pkg>-show-depends"
individually for eack package, which was very slow. Now, it calls
"make <pkg1>-show-depends <pkg2>-show-depends ... <pkgN>-show-depends"
for all packages it knows, and then does that recursively. It reduces
the number of make invocations to the deepest dependency chain in the
current configuration, instead of having a number of make invocations
equal to the number of enabled packages.

For a configuration with xvkbd enabled (which brings a significant
number of X.org dependencies) and a tar root filesystem, the time to
execute graph-depends was:

real 5m14.944s
user 4m53.590s
sys 0m14.069s

After our optimizations, it is now:

real 0m33.096s
user 0m30.878s
sys 0m1.472s

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
support/scripts/graph-depends