[PATCH] D66031: clangd: use -j for background index pool
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 9 14:18:57 PDT 2019
sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.
Yeah, this is much better than only having `-background-index=no`.
I think we should merge this into the 9.0 branch if we still can.
================
Comment at: clang-tools-extra/clangd/ClangdServer.cpp:152
+ std::forward<decltype(DBSF)>(DBSF),
+ Opts.AsyncThreadsCount );
+ } else {
----------------
can we use `std::max(Opts.AsyncThreadsCount, 1)` instead?
Having `-sync -background-index` use one thread seems less weird than having it use all the cores.
(Or at least not more weird, and simpler in the code here)
================
Comment at: clang-tools-extra/clangd/ClangdServer.cpp:156
+ Context::current().clone(), FSProvider, CDB,
+ std::forward<decltype(DBSF)>( DBSF ) );
+ }
----------------
nit: clang-format
================
Comment at: clang-tools-extra/clangd/tool/ClangdMain.cpp:311
cat(Misc),
- desc("Parse on main thread. If set, -j is ignored"),
+ desc("Parse on main thread. If set, -j is only applied to background index"),
init(false),
----------------
while here... "parse" is a bit outdated, could this be something like "Handle requests on the main thread. The background index still gets its own thread"
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66031/new/
https://reviews.llvm.org/D66031
More information about the cfe-commits
mailing list