diff options
author | Nico Weber <nicolasweber@gmx.de> | 2012-06-15 04:52:17 (GMT) |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2012-06-15 19:55:30 (GMT) |
commit | 5be83d0b2e4909f39998c98dde9a1393d8e5f1c2 (patch) | |
tree | 0fe7e6a270543c5142de887963c32682c7ec2545 /src/test.cc | |
parent | 8f686fae940e9d2dfb86cb8cbb5ee11176ae03de (diff) | |
download | Ninja-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/test.cc')
-rw-r--r-- | src/test.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test.cc b/src/test.cc index 2fbb4df..afedd10 100644 --- a/src/test.cc +++ b/src/test.cc @@ -18,6 +18,7 @@ #include <errno.h> +#include "build_log.h" #include "parsers.h" #include "util.h" @@ -89,6 +90,10 @@ void AssertParse(State* state, const char* input) { ASSERT_EQ("", err); } +void AssertHash(const char* expected, uint64_t actual) { + ASSERT_EQ(BuildLog::LogEntry::HashCommand(expected), actual); +} + void VirtualFileSystem::Create(const string& path, int time, const string& contents) { files_[path].mtime = time; |