This repository has been archived by the owner on Apr 23, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cmake] Speed up check-llvm 5x by delay loading shell32 and ole32
Summary: Previously, check-llvm on my Windows 10 workstation took about 300s to run, and it would lock up my mouse. Now, it takes just under 60s. Previously running the tests only used about 15% of the available CPU time, now it uses up to 60%. Shell32.dll and ole32.dll have direct dependencies on user32.dll and gdi32.dll. These DLLs are mostly used to for Windows GUI functionality, which most LLVM tools don't need. It seems that these DLLs acquire and release some system resources on startup and exit, and that requires acquiring the same highly contended lock discussed in this post: https://randomascii.wordpress.com/2017/07/09/24-core-cpu-and-i-cant-move-my-mouse/ Most LLVM tools still have a transitive dependency on SHGetKnownFolderPathW, which is used to look up the user home directory and local AppData directory. We also use SHFileOperationW to recursively delete a directory, but only LLDB and clang-doc use this today. At some point, we might consider removing these last shell32.dll deps, but for now, I would like to take this free performance. Many thanks to Bruce Dawson for suggesting this fix. He looked at an ETW trace of an LLVM test run, noticed these DLLs, and suggested avoiding them. Reviewers: zturner, pcc, thakis Subscribers: mgorny, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D51952 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342002 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information