Page MenuHomePhabricator

COFF: Cache the result of library searches.
ClosedPublic

Authored by pcc on Dec 15 2016, 7:35 PM.

Details

Summary

File system operations were still dominating the profile on Windows. In this
case we were spending a significant amount of our time repeatedly searching
for libraries as a result of processing linker directives. Address this
by caching whether we have already found a library with a given name. For
chrome_child.dll:

Before: 10.53s
After: 6.88s

Diff Detail

Repository
rL LLVM

Event Timeline

pcc updated this revision to Diff 81709.Dec 15 2016, 7:35 PM
pcc retitled this revision from to COFF: Cache the result of library searches..
pcc updated this object.
pcc added a reviewer: ruiu.
pcc added a subscriber: llvm-commits.
ruiu edited edge metadata.Dec 15 2016, 7:42 PM

LGTM. Impressive speedup! Maybe we could speed this up even more by caching directory contents we visited? I don't know how much time we still spend on file searching after this patch though.

lld/COFF/Driver.h
93 ↗(On Diff #81709)

Write in two lines.

ruiu accepted this revision.Dec 15 2016, 7:42 PM
ruiu edited edge metadata.
This revision is now accepted and ready to land.Dec 15 2016, 7:42 PM
pcc added a comment.Dec 15 2016, 7:53 PM
In D27840#624682, @ruiu wrote:

LGTM. Impressive speedup! Maybe we could speed this up even more by caching directory contents we visited? I don't know how much time we still spend on file searching after this patch though.

File system operations have now completely disappeared from the profile (other than mmap, which has already been moved off the hot path), so I think we're done optimizing our file system operations for now.

This revision was automatically updated to reflect the committed changes.