Issue 234449
Summary [lldb] Startup slowdown caused by PluginManager recursively scanning every file in /usr/lib
Labels new issue
Assignees
Reporter memchr
    During startup, lldb's plugin manager [scans every file recursively](https://github.com/llvm/llvm-project/blob/416f328b939fe1373ddc9060f6773ad4c5039f59/lldb/source/Core/PluginManager.cpp#L283-L294) in the directory where liblldb.so is located. This is usually in the /usr/lib directory on Linux. Because this directory also contains Linux kernel modules, firmware blobs, global python packages and cache, and lots of other unrelated files, startup becomes painfully slow and results in excessive IO on systems where lots of packages have been installed.

## Reproducing
Compile lldb from the main branch and install it on Linux. Note that this installs to /usr, so it is best to do so in a container.
```sh
cmake -S llvm -B build \
	-G Ninja \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DLLVM_ENABLE_PROJECTS='lldb'

ninja -C build install-lldb
```
Run lldb with strace:
```
strace /usr/bin/lldb
```
`newfstatat` was called for all the files in the /usr/lib directory

[strace.txt](https://github.com/user-attachments/files/33795960/strace.txt)
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to