summaryrefslogtreecommitdiffstats
path: root/src/graph.cc
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2012-06-15 04:52:17 (GMT)
committerNico Weber <nicolasweber@gmx.de>2012-06-15 19:55:30 (GMT)
commit5be83d0b2e4909f39998c98dde9a1393d8e5f1c2 (patch)
tree0fe7e6a270543c5142de887963c32682c7ec2545 /src/graph.cc
parent8f686fae940e9d2dfb86cb8cbb5ee11176ae03de (diff)
downloadNinja-5be83d0b2e4909f39998c98dde9a1393d8e5f1c2.zip
Ninja-5be83d0b2e4909f39998c98dde9a1393d8e5f1c2.tar.gz
Ninja-5be83d0b2e4909f39998c98dde9a1393d8e5f1c2.tar.bz2
Only store command hashes in the build log.
.build_log load time 350ms -> 17ms, filesize 197MB -> 1.6MB on Mac. On Windows, it's 500ms -> 20ms. Makes the build log a lot less useful for scripts, but there could be a tool for use cases that need log information. A prototype of such a tool is in https://github.com/nico/ninja/commit/1b243d311 The hash function is 64bit murmurhash2. Assuming that that different commands get the same hash only by chance, it's is very unlikely for two different commands to hash to the same value with a 64bit hash.
Diffstat (limited to 'src/graph.cc')
-rw-r--r--src/graph.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/graph.cc b/src/graph.cc
index 3531e86..f381d8a 100644
--- a/src/graph.cc
+++ b/src/graph.cc
@@ -157,7 +157,7 @@ bool Edge::RecomputeOutputDirty(BuildLog* build_log,
// dirty.
if (!rule_->generator() && build_log &&
(entry || (entry = build_log->LookupByOutput(output->path())))) {
- if (command != entry->command) {
+ if (BuildLog::LogEntry::HashCommand(command) != entry->command_hash) {
EXPLAIN("command line changed for %s", output->path().c_str());
return true;
}
@@ -200,7 +200,7 @@ string EdgeEnv::LookupVariable(const string& var) {
} else if (edge_->env_) {
return edge_->env_->LookupVariable(var);
} else {
- // XXX shoudl we warn here?
+ // XXX should we warn here?
return string();
}
}