Ah, then this was probably me:
https://github.com/martine/ninja/commit/686fd98828e27008ddd0f58b4c180f536168d49c
https://github.com/martine/ninja/commit/3fbb25b2cc66f236a39b728d20e5d44da23612ac
It should be easy to adjust the ifdefs in hash_map.h to do the right
thing. I don't have a Windows box handy so please send a patch if
you've got one. :)
Sure, the patches I introduced it in are these:
1) Make the map of path string -> path up-to-date state use char*
https://github.com/martine/ninja/commit/686fd98828e27008ddd0f58b4c180f536168d49c
2) Make the map of path string -> logged info about path use char* as well
https://github.com/martine/ninja/commit/3fbb25b2cc66f236a39b728d20e5d44da23612ac
In total it looks like they shaved 50ms off of Chrome no-op build times.
Unfortunately I don't have a useful test to prove that with, beyond
what I did at the time: build Chrome both before and after the patch.
Since the change is only an optimization and not a semantics change, I
think if the test suite passes you could consider any implementation
correct enough. I've never profiled Ninja on Windows, so there could
easily be some low-hanging fruit that is particular to MSVC.
Additionally, ExternalStringHash<Foo*>::Type stuff (see the second
patch above) is a bit of C++ hackery that is above my C++ skill level,
so if there's a better way to do that I welcome ideas.
Hi guys,
I am not a C++ expert too but these two patches above looks overkill
to me. If there is really such a difference between hash_map
implementation across compilers (as the link to the gamedev forum from
Frances says), then I am sure some cross-platform libraries /
executable have already found portable work around. I think it worth
to have a look at them to take a decision. Maybe something already
exists in the wild and we could just reuse it. I will try to find the
time to have a deeper look at this issue.
Cheers,
--
Nicolas Desprès