aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/ThreadPool.cpp
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2021-06-22 15:35:23 -0700
committerFangrui Song <i@maskray.me>2021-06-22 15:35:24 -0700
commite387778722f93705db903aa755529568a05dd9db (patch)
treeb0a33f0986d6659b73b0022e1994c7965083904e /llvm/lib/Support/ThreadPool.cpp
parent1cfdcae653140b1df5932767862a08f5a1b6106f (diff)
downloadllvm-e387778722f93705db903aa755529568a05dd9db.zip
llvm-e387778722f93705db903aa755529568a05dd9db.tar.gz
llvm-e387778722f93705db903aa755529568a05dd9db.tar.bz2
[ELF] Optimize ScriptLexer::getLineNumber by caching the previous line number and offset
getLineNumber() was counting the number of line feeds from the start of the buffer to the current token. For large linker scripts this became a performance bottleneck. For one 4MB linker script over 4 minutes was spent in getLineNumber's StringRef::count. Store the line number from the last token, and only count the additional line feeds since the last token. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D104137
Diffstat (limited to 'llvm/lib/Support/ThreadPool.cpp')
0 files changed, 0 insertions, 0 deletions