[all-commits] [llvm/llvm-project] d19f06: [clang][Tooling] Try to avoid file system access i...
Aleksandr Platonov via All-commits
all-commits at lists.llvm.org
Fri Jul 17 09:50:28 PDT 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: d19f0666bcd8f7d26aaf4019244c3ed91e47b1b7
https://github.com/llvm/llvm-project/commit/d19f0666bcd8f7d26aaf4019244c3ed91e47b1b7
Author: Aleksandr Platonov <platonov.aleksandr at huawei.com>
Date: 2020-07-17 (Fri, 17 Jul 2020)
Changed paths:
M clang/lib/Tooling/FileMatchTrie.cpp
M clang/unittests/Tooling/CompilationDatabaseTest.cpp
Log Message:
-----------
[clang][Tooling] Try to avoid file system access if there is no record for the file in compile_commads.json
Summary:
If there is no record in compile_commands.json, we try to find suitable record with `MatchTrie.findEquivalent()` call.
This is very expensive operation with a lot of `llvm::sys::fs::equivalent()` calls in some cases.
This patch disables file symlinks for performance reasons.
Example scenario without this patch:
- compile_commands.json generated at clangd build (contains ~3000 files).
- it tooks more than 1 second to get compile command for newly created file in the root folder of LLVM project.
- we wait for 1 second every time when clangd requests compile command for this file (at file change).
Reviewers: sammccall, kadircet, hokein
Reviewed By: sammccall
Subscribers: chandlerc, djasper, klimek, ilya-biryukov, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D83621
More information about the All-commits
mailing list