Merge branch 'stringpiece-hash'
authorEvan Martin <martine@danga.com>
Thu, 12 Jan 2012 19:21:06 +0000 (11:21 -0800)
committerEvan Martin <martine@danga.com>
Thu, 12 Jan 2012 19:21:06 +0000 (11:21 -0800)
This branch changed the fundamental key used in hashes in Ninja from
char* to StringPiece.  Using StringPiece allows us to eliminate some
copies and null termination in various places.

While I was at it, I switched the hash function to the Murmur hash.

Seems to be ~100ms faster:

evmar:/work/chrome/src$ ~/projects/ninja/misc/measure.py ~/projects/ninja/ninja-trunk -C out/Debug chrome
sampling: 994ms 1010ms 1000ms 999ms 1019ms 994ms 1002ms 993ms 997ms 1040ms
estimate: 993ms (mean err 11.6ms)
evmar:/work/chrome/src$ ~/projects/ninja/misc/measure.py ~/projects/ninja/ninja -C out/Debug chrome
sampling: 888ms 895ms 891ms 886ms 896ms 888ms 891ms 903ms 895ms 888ms
estimate: 886ms (mean err 5.7ms)


Trivial merge