[PATCH] D51887: lld-link: Set PDB GUID to hash of PDB contents instead of to a random byte sequence.

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 13 10:50:14 PDT 2018


thakis added a comment.

The situation on Windows is like on Linux. I built chrome.dll with our pinned lld (which was compiled with clang), with a locally-built lld (built by msvc 2017), and then with this patch and the other two patches linked from here. Min-of-5 times are comparable (full data in parens):

pinned lld, chromedll: 41.2s (42.0s, 45.0s, 41.9s, 43.5s, 41.2s)
trunk lld, chrome.dll: 48.1s (48.3, 48.1, 49.0, 51.0, 49.3)
patched lld, chrome.dll: 48.6s (48.6s, 50.7s, 51.1s, 48.8s, 48.8s)
patched lld, naive hash, chrome.dll: 47.4s (48.8s, 51.0s, 51.5s, 51.0s, 47.4s)
patched lld, parallel hash, chrome.dll: 46.7s (50.2s, 47.9s, 47.8s, 46.7s, 48.8s)

After looking at this data again, the "naive hash" line looked a bit slower than the rest so i re-ran those 5 links and got

patched lld, naive hash, chrome.dll, again: 45.8s (46.9s, 45.8s, 46.1s, 45.8s, 48.5s)

So measurement noise is pretty high :-/ Pinned lld is consistently faster (due to being built by clang), but how exactly the hash is computed doesn't matter. So I suppose https://reviews.llvm.org/D51956 is the way to go. I'll give that a real patch description and send it out.

To get the time, I first built all of chrome_dll, then deleted chrome.dll and got the build target like so: `ninja -C out\gn chrome_dll ; del out\gn\chrome.dll; ninja -C out\gn chrome_dll -v -d keeprsp`

Then I ran the link command with my locally-built lld like so: `C:\src\chrome\src\out\gn>..\..\..\..\tim\tim ninja -t msvc -e environment.x64 -- ../../../../llvm-mono/out/gn/bin/lld-link.exe /nologo /IMPLIB:./chrome.dll.lib /DLL /OUT:./chrome.dll /PDB:./chrome.dll.pdb @./chrome.dll.rsp`

(tim is https://github.com/sgraham/tim)

(re md5: Let's do that in a follow-up since it needs re-measuring and will be a single-file change then. The 8 byte hash still gives decent hash collision resistance for up to 2**32 different pdb files, and snce pdbs are keyed by executable name on the symbol server that's per binary. Projects tend to have far fewer revisions than 4 billion.)


https://reviews.llvm.org/D51887





More information about the llvm-commits mailing list