[Lldb-commits] [lldb] [lldb][Darwin] Batch debugserver Mach-O load-command reads (PR #232684)
Karim Alweheshy via lldb-commits
lldb-commits at lists.llvm.org
Tue Oct 20 03:54:53 PDT 2026
karim-alweheshy wrote:
@jasonmolenda I have isolated numbers for the current 16 KB implementation now. These are medians in milliseconds:
| Synthetic fixture | All-images query: before → after | Target creation + attach: before → after |
| --- | ---: | ---: |
| 8 dylibs (54 images total) | 8.38 → 1.77 | 57.99 → 49.85 |
| 128 dylibs (174 images total) | 66.94 → 4.60 | 138.49 → 76.09 |
The larger fixture saves about 62 ms in the inclusive operation (1.82× faster), with the query itself 14.55× faster. Both metrics improved in all six paired runs at each size; returned image metadata matched after normalizing load addresses. Real-app savings still need to be measured.
<details>
<summary>Setup and measurement boundaries</summary>
- Apple M4, 10 cores, macOS 26.7.1; Xcode 27A266a / LLDB 2103.0.34.103. Same installed LLDB client for both arms.
- Both debugservers built arm64 Release through the same Xcode project: parent `6c2e4efb5dbb7f1604d49baac89c7fea411ded1f` versus PR head `26607d420240826749fbac86ee10bf1bb76ae0e6`. Only the two production files in this PR differ.
- Plain C process loads 8 or 128 dylibs using `dlopen(RTLD_NOW | RTLD_LOCAL)`, then waits. Each dylib has 270 load commands / 23.2 KB of commands, including 256 synthetic unused `LC_RPATH` entries. This deliberately exercises command traversal.
- Six runs per arm and size, alternating AB/BA order: 24 measured runs. Fresh inferior and LLDB process each time, warmed file/signature caches, logging disabled. Load average stayed below 4 before and after every case (maximum observed 2.75).
- Inclusive timing covers `SBDebugger.CreateTarget` through synchronous `SBTarget.AttachToProcessWithID`. CLI startup and fixture loading happen before that interval. The separately timed query is `jGetLoadedDynamicLibrariesInfos:{"fetch_all_solibs":true}`, issued after attach, so it is warm.
</details>
https://github.com/llvm/llvm-project/pull/232684
More information about the lldb-commits
mailing list