This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Optimize "don't include me" check.
ClosedPublic

Authored by sammccall on Apr 25 2019, 2:14 AM.

Details

Summary

llvm::Regex is really slow, and regex evaluation during preamble indexing was
showing up as 25% on a profile of clangd in a codebase with large preambles.

Event Timeline

sammccall created this revision.Apr 25 2019, 2:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 25 2019, 2:14 AM
ilya-biryukov accepted this revision.Apr 25 2019, 3:19 AM

LGTM (see the comment about a typo, though)

clangd/index/SymbolCollector.cpp
669

A typo? Should it be include.

This revision is now accepted and ready to land.Apr 25 2019, 3:19 AM
sammccall added inline comments.Apr 25 2019, 3:29 AM
clangd/index/SymbolCollector.cpp
669

it's meant to match "include" or "including". I'll add a comment.

ilya-biryukov added inline comments.Apr 25 2019, 3:30 AM
clangd/index/SymbolCollector.cpp
669

Makes sense. Comment would work, thanks!

This revision was automatically updated to reflect the committed changes.
sammccall marked 3 inline comments as done.