llvm-project/clang-tools-extra
Sam McCall 4bd6ebb495 clangd: use -j for background index pool
Summary:
clangd supports a -j option to limit the amount of threads to use for parsing
TUs. However, when using -background-index (the default in later versions of
clangd), the parallelism used by clangd defaults to the hardware_parallelisn,
i.e. number of physical cores.

On shared hardware environments, with large projects, this can significantly
affect performance with no way to tune it down.

This change makes the -j parameter apply equally to parsing and background
index. It's not perfect, because the total number of threads is 2x the -j value,
which may still be unexpected. But at least this change allows users to prevent
clangd using all CPU cores.

Reviewers: kadircet, sammccall

Reviewed By: sammccall

Subscribers: javed.absar, jfb, sammccall, ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66031

llvm-svn: 368498
2019-08-09 23:03:32 +00:00
..
clang-apply-replacements Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC 2019-08-05 05:43:48 +00:00
clang-change-namespace [clang-tools-extra] Adopt FileManager's error-returning APIs 2019-08-01 21:32:01 +00:00
clang-doc [clang-doc] Generate an HTML index file 2019-08-09 20:52:28 +00:00
clang-include-fixer Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC 2019-08-05 05:43:48 +00:00
clang-move Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC 2019-08-05 05:43:48 +00:00
clang-query gn build: Add build files for some clang-tools-extra 2019-03-20 16:14:16 +00:00
clang-reorder-fields [clang-tools-extra] Adopt FileManager's error-returning APIs 2019-08-01 21:32:01 +00:00
clang-tidy Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC 2019-08-05 05:43:48 +00:00
clang-tidy-vs Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
clangd clangd: use -j for background index pool 2019-08-09 23:03:32 +00:00
docs [clang-format] Add link to source code in file definitions 2019-08-09 17:49:41 +00:00
modularize Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC 2019-08-05 05:43:48 +00:00
pp-trace Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC 2019-08-05 05:43:48 +00:00
test [clang-tidy] Add FixItHint for performance-noexcept-move-constructor 2019-08-04 13:32:39 +00:00
tool-template Rename clangToolingRefactor to clangToolingRefactoring for consistency with its directory 2019-05-25 00:27:19 +00:00
unittests [clang-format] Add link to source code in file definitions 2019-08-09 17:49:41 +00:00
.arcconfig [clang-tools-extra] Set up .arcconfig to point to new Diffusion CTE repository 2017-11-27 15:58:25 +00:00
.gitignore
CMakeLists.txt [clangd] add CLANG_ENABLE_CLANGD option to build clangd. Require threads. 2019-05-07 07:05:47 +00:00
CODE_OWNERS.TXT Update CODE_OWNERS.txt for clang-doc 2019-06-28 17:32:26 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
README.txt

README.txt

//===----------------------------------------------------------------------===//
// Clang Tools repository
//===----------------------------------------------------------------------===//

Welcome to the repository of extra Clang Tools.  This repository holds tools
that are developed as part of the LLVM compiler infrastructure project and the
Clang frontend.  These tools are kept in a separate "extra" repository to
allow lighter weight checkouts of the core Clang codebase.

This repository is only intended to be checked out inside of a full LLVM+Clang
tree, and in the 'tools/extra' subdirectory of the Clang checkout.

All discussion regarding Clang, Clang-based tools, and code in this repository
should be held using the standard Clang mailing lists:
  http://lists.llvm.org/mailman/listinfo/cfe-dev

Code review for this tree should take place on the standard Clang patch and
commit lists:
  http://lists.llvm.org/mailman/listinfo/cfe-commits

If you find a bug in these tools, please file it in the LLVM bug tracker:
  http://llvm.org/bugs/