martine/ninja — pull request #310 by nico (2012-05-10 05:48:03+00:00)
Title: Speed up build log reading (0.5s on Win, 0.1s on Mac, 30ms on Linux)

See the commit log on the second commit for timing details.

I tried several other approaches to make build log loading faster, but this approach looks the most understandable to me. It also has the potential for another .1s speedup on Mac.

https://github.com/nico/ninja/compare/speedup2 is how this change looks if done inline without the extra class (that patch is still missing the s/strstr/memchr/ – else the tests in my other pull request will fail – so that diff looks a bit _too_ small), but I find the code easier to understand with the extra class.

The Linux / Mac speedup is directly visible when doing an empty chrome build. I didn't manage to test on Windows, because that needs all kinds of stuff from Scott's branch apparently.