summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKadir Cetinkaya <kadircet@google.com>2019-02-07 16:04:30 +0000
committerKadir Cetinkaya <kadircet@google.com>2019-02-07 16:04:30 +0000
commitee23633eab7254c762422778bfccd61b9f659b30 (patch)
treeb934b38be427d8384f549a32d6c2f24b5edb3a80
parentddd64a4f50bd9afbf15cefb9497d49ebc544dce8 (diff)
downloadbcm5719-llvm-ee23633eab7254c762422778bfccd61b9f659b30.tar.gz
bcm5719-llvm-ee23633eab7254c762422778bfccd61b9f659b30.zip
[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 llvm-svn: 353422
-rw-r--r--clang-tools-extra/clangd/index/Background.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/clang-tools-extra/clangd/index/Background.h b/clang-tools-extra/clangd/index/Background.h
index ea8ab5812f1..808c03a3955 100644
--- a/clang-tools-extra/clangd/index/Background.h
+++ b/clang-tools-extra/clangd/index/Background.h
@@ -67,11 +67,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.
OpenPOWER on IntegriCloud