help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dependence based on whether files has been changed


From: Eric Melski
Subject: Re: Dependence based on whether files has been changed
Date: Mon, 16 May 2011 11:46:13 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10

On 05/16/2011 11:00 AM, Philip Guenther wrote:
On Mon, May 16, 2011 at 9:17 AM, Peng Yu<address@hidden>  wrote:
Scons has the support for updating target only if the dependent file
contents are changed.
http://www.scons.org/doc/0.98.5/HTML/scons-user/c779.html

I know that it may not always easy and possible to duplicate feature
of other tools. But GNU make is still faster than scons and sometime
much faster than scons (especially if there are many dependences in a
Makefile). Considering this I'd still rather use make than scons.

Therefore, I'm wondering if there is any plan to add the features
based on file contents in GNU make in the future.

Maybe part of the reason that GNU make is faster than scons is that
scons is actually checking the contents of all the source files to see
whether they changed while GNU make only has to compare the timestamps
on the files.  If so, then putting the "check contents of the files"
feature into GNU make will make it just as slow.

SCons' performance problems have almost nothing to do with computing md5 hashes of the input files, and everything to do with a bad graph traversal implementation. To the best of my understanding, it rescans the entire graph each time it needs to pick another target to update, on the off chance that the update of a previous target has added dependencies to the graph (similar in intent to makefile remaking in GNU make, but less efficient).

I'll note that it's possible to write makefile rules to do content
comparison of files.  I know I've posted at least one version of
example rules to do that to the list, though I don't use them myself
and make no claims about performance.  Check the archive for details.

There's also a Mr. Make article covering the same:

http://www.cmcrossroads.com/ask-mr-make/6795-rebuilding-when-a-files-checksum-changes

br,

Eric Melski
Architect
Electric Cloud, Inc.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]