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/build_log_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/build_log_test.cc')
-rw-r--r-- | src/build_log_test.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/build_log_test.cc b/src/build_log_test.cc index 199e016..afd3b81 100644 --- a/src/build_log_test.cc +++ b/src/build_log_test.cc @@ -110,7 +110,7 @@ TEST_F(BuildLogTest, DoubleEntry) { BuildLog::LogEntry* e = log.LookupByOutput("out"); ASSERT_TRUE(e); - ASSERT_EQ("command def", e->command); + ASSERT_NO_FATAL_FAILURE(AssertHash("command def", e->command_hash)); } TEST_F(BuildLogTest, Truncate) { @@ -164,7 +164,7 @@ TEST_F(BuildLogTest, UpgradeV3) { ASSERT_EQ(123, e->start_time); ASSERT_EQ(456, e->end_time); ASSERT_EQ(0, e->restat_mtime); - ASSERT_EQ("command", e->command); + ASSERT_NO_FATAL_FAILURE(AssertHash("command", e->command_hash)); } TEST_F(BuildLogTest, SpacesInOutputV4) { @@ -183,7 +183,7 @@ TEST_F(BuildLogTest, SpacesInOutputV4) { ASSERT_EQ(123, e->start_time); ASSERT_EQ(456, e->end_time); ASSERT_EQ(456, e->restat_mtime); - ASSERT_EQ("command", e->command); + ASSERT_NO_FATAL_FAILURE(AssertHash("command", e->command_hash)); } TEST_F(BuildLogTest, DuplicateVersionHeader) { @@ -207,14 +207,14 @@ TEST_F(BuildLogTest, DuplicateVersionHeader) { ASSERT_EQ(123, e->start_time); ASSERT_EQ(456, e->end_time); ASSERT_EQ(456, e->restat_mtime); - ASSERT_EQ("command", e->command); + ASSERT_NO_FATAL_FAILURE(AssertHash("command", e->command_hash)); e = log.LookupByOutput("out2"); ASSERT_TRUE(e); ASSERT_EQ(456, e->start_time); ASSERT_EQ(789, e->end_time); ASSERT_EQ(789, e->restat_mtime); - ASSERT_EQ("command2", e->command); + ASSERT_NO_FATAL_FAILURE(AssertHash("command2", e->command_hash)); } TEST_F(BuildLogTest, VeryLongInputLine) { @@ -242,5 +242,5 @@ TEST_F(BuildLogTest, VeryLongInputLine) { ASSERT_EQ(456, e->start_time); ASSERT_EQ(789, e->end_time); ASSERT_EQ(789, e->restat_mtime); - ASSERT_EQ("command2", e->command); + ASSERT_NO_FATAL_FAILURE(AssertHash("command2", e->command_hash)); } |