summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2023-04-12 13:13:38 -0700
committerFangrui Song <i@maskray.me>2023-04-12 13:13:38 -0700
commitda68d2164efcc1f5e57f090e2ae2219056b120a0 (patch)
tree3c7f265a0830b7b3e765cc6c0461d1297da4dc13 /lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
parent9bc5e8c87e9be8db2d65e71f90ba0ceea4b814a4 (diff)
[ELF] Cap parallel::strategy to 16 threads when --threads= is unspecified
When --threads= is unspecified, we set it to `parallel::strategy.compute_thread_count()`, which uses sched_getaffinity (Linux)/cpuset_getaffinity (FreeBSD)/std::thread::hardware_concurrency (others). With extensive testing on many machines (many configurations from {aarch64,x86-64} x {Linux,FreeBSD,Windows} x allocators(native,mimalloc,rpmalloc) combinations) with varying workloads, we discovered that when the concurrency is larger than 16, the linking process is slower than using --threads=16 due to parallelism overhead outweighs optimizations. This is particularly harmful for machines with many cores or when the link job competes with other jobs. Cap parallel::strategy when --threads= is unspecified. For some workloads changing the concurrency from 8 to 16 has nearly no improvement. --thinlto-jobs= is unchanged since ThinLTO backend compiles are embarrassingly parallel. Link: https://discourse.llvm.org/t/avoidable-overhead-from-threading-by-default/69160 Reviewed By: peter.smith Differential Revision: https://reviews.llvm.org/D147493
Diffstat (limited to 'lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp')
0 files changed, 0 insertions, 0 deletions