Skip to content

Commit a4fc388

Browse files
committed
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 ------------------------------------------------------------------------ llvm-svn: 354980
1 parent b02e236 commit a4fc388

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

clang-tools-extra/clangd/index/Background.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,12 @@ class BackgroundIndex : public SwapIndex {
6868
/// If BuildIndexPeriodMs is greater than 0, the symbol index will only be
6969
/// rebuilt periodically (one per \p BuildIndexPeriodMs); otherwise, index is
7070
/// rebuilt for each indexed file.
71-
BackgroundIndex(Context BackgroundContext, const FileSystemProvider &,
72-
const GlobalCompilationDatabase &CDB,
73-
BackgroundIndexStorage::Factory IndexStorageFactory,
74-
size_t BuildIndexPeriodMs = 0,
75-
size_t ThreadPoolSize = llvm::hardware_concurrency());
71+
BackgroundIndex(
72+
Context BackgroundContext, const FileSystemProvider &,
73+
const GlobalCompilationDatabase &CDB,
74+
BackgroundIndexStorage::Factory IndexStorageFactory,
75+
size_t BuildIndexPeriodMs = 0,
76+
size_t ThreadPoolSize = llvm::heavyweight_hardware_concurrency());
7677
~BackgroundIndex(); // Blocks while the current task finishes.
7778

7879
// Enqueue translation units for indexing.

0 commit comments

Comments
 (0)