[PATCH] D66031: clangd: use -j for background index pool

Ben Jackson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 9 14:44:59 PDT 2019


puremourning added inline comments.


================
Comment at: clang-tools-extra/clangd/ClangdServer.cpp:152
+          std::forward<decltype(DBSF)>(DBSF),
+          Opts.AsyncThreadsCount );
+    } else {
----------------
sammccall wrote:
> 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)
Hmm. What I was thinking is more that if you specify none of sync or -j, you should get physical cores as you do now.

But I realise that this change doesn't do that, because AsyncThreadsCount defaults slightly differently  to `llvm::heavyweight_hardware_concurrency()` (it uses std::thread::hardware_concurrency)

The difference is pretty small, so probably not material ?


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