[clangd] Support external throttler for preamble builds
authorSam McCall <sam.mccall@gmail.com>
Tue, 5 Jul 2022 00:33:04 +0000 (02:33 +0200)
committerSam McCall <sam.mccall@gmail.com>
Wed, 6 Jul 2022 12:58:24 +0000 (14:58 +0200)
commited0e20d5e8c5d6c679d2cead674654541fa10e1b
treefa3060081558568b9aad738c56111a6de7b66e39
parent0a9eb870f5f85d7d07e020f9998f208cddecc89d
[clangd] Support external throttler for preamble builds

Building preambles is the most resource-intensive thing clangd does, driving
peak RAM and sustained CPU usage.

In a hosted environment where multiple clangd instances are packed into the same
container, it's useful to be able to limit the *aggregate* resource peaks.

Differential Revision: https://reviews.llvm.org/D129100
clang-tools-extra/clangd/ClangdServer.cpp
clang-tools-extra/clangd/ClangdServer.h
clang-tools-extra/clangd/TUScheduler.cpp
clang-tools-extra/clangd/TUScheduler.h
clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp