OSDN Git Service

[dsymutil] Be smarter in caching calls to realpath
authorJonas Devlieghere <jonas@devlieghere.com>
Thu, 22 Feb 2018 09:20:40 +0000 (09:20 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Thu, 22 Feb 2018 09:20:40 +0000 (09:20 +0000)
commit446383569640fedf743bf02569db2023341e2efe
treef6e4aecfba3d4f15ab1e8a0356438da1fc1e6bec
parent558fe7603270b6525ce13ad6227217c341771f75
[dsymutil] Be smarter in caching calls to realpath

Calling realpath is expensive but necessary to perform the uniqueing in
dsymutil. Although we already cached the results for every individual
file in the line table, we had reports of it taking 40 seconds of a 3.5
minute link.

This patch adds a second level of caching. When we do have to call
realpath, we cache its result for its parents path. We didn't replace
the existing caching, because it's fast (indexed) and saves us from
reading the line table for entries we've already seen.

For WebkitCore this results in a decrease of 11% in linking time: from
85.79 to 76.11 seconds (average over 3 runs).

Differential revision: https://reviews.llvm.org/D43511

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325757 91177308-0d34-0410-b5e6-96231b3b80d8
tools/dsymutil/DwarfLinker.cpp