[all-commits] [llvm/llvm-project] 296f76: [lldb][test] Speed up lldb arch determination (NFC)

Dave Lee via All-commits all-commits at lists.llvm.org
Mon Aug 29 10:21:15 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 296f7614edcfb9ac52842d9b952d6eadb0ad6edf
      https://github.com/llvm/llvm-project/commit/296f7614edcfb9ac52842d9b952d6eadb0ad6edf
  Author: Dave Lee <davelee.com at gmail.com>
  Date:   2022-08-29 (Mon, 29 Aug 2022)

  Changed paths:
    M lldb/packages/Python/lldbsuite/test/lldbtest.py

  Log Message:
  -----------
  [lldb][test] Speed up lldb arch determination (NFC)

While investigation slow tests, I looked into why `TestMultithreaded.py`. One
of the reasons is that it determines the architecture of lldb by running:

```
lldb -o 'file path/to/lldb' -o 'quit'
```

On my fairly fast machine, this takes 24 seconds, and `TestMultithreaded.py`
calls this function 4 times.

With this change, this command now takes less than 0.2s on the same machine.

The reason it's slow is symbol table and debug info loading, as indicated by
the new progress events printed to the console. One setting reduced the time in
half:

```
settings set target.preload-symbols false
```

Further investigation, by profiling with Instruments on macOS, showed that
loading time was also caused by looking for scripts. The setting that
eliminates this time is:

```
settings set target.load-script-from-symbol-file false
```

Differential Revision: https://reviews.llvm.org/D132803




More information about the All-commits mailing list