diff options
author | Hans Wennborg <hans@hanshq.net> | 2019-02-27 14:52:42 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2019-02-27 14:52:42 +0000 |
commit | 04e2ae0678f5d620983133f050452e7a7a44d0a8 (patch) | |
tree | acff160c148b30c888467bfa10ef946e676b896c | |
parent | 2037a377d962ca4ed63f3a5632cc7b1d948e4c8e (diff) |
Merging r353422:
------------------------------------------------------------------------
r353422 | kadircet | 2019-02-07 17:04:30 +0100 (Thu, 07 Feb 2019) | 18 lines
[clangd] Reduce number of threads used by BackgroundIndex to number of physical cores.
Summary:
clangd is using as many threads as logical cores for BackgroundIndex
by default. We observed that it increases latency of foreground tasks.
This patch aims to change that default to number of physical cores to get rid of
that extra latency.
Reviewers: ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D57819
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/branches/release_80@354980 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | clangd/index/Background.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/clangd/index/Background.h b/clangd/index/Background.h index 81675be5..ffa83e60 100644 --- a/clangd/index/Background.h +++ b/clangd/index/Background.h @@ -68,11 +68,12 @@ public: /// If BuildIndexPeriodMs is greater than 0, the symbol index will only be /// rebuilt periodically (one per \p BuildIndexPeriodMs); otherwise, index is /// rebuilt for each indexed file. - BackgroundIndex(Context BackgroundContext, const FileSystemProvider &, - const GlobalCompilationDatabase &CDB, - BackgroundIndexStorage::Factory IndexStorageFactory, - size_t BuildIndexPeriodMs = 0, - size_t ThreadPoolSize = llvm::hardware_concurrency()); + BackgroundIndex( + Context BackgroundContext, const FileSystemProvider &, + const GlobalCompilationDatabase &CDB, + BackgroundIndexStorage::Factory IndexStorageFactory, + size_t BuildIndexPeriodMs = 0, + size_t ThreadPoolSize = llvm::heavyweight_hardware_concurrency()); ~BackgroundIndex(); // Blocks while the current task finishes. // Enqueue translation units for indexing. |