Problem
Launching Unreal Engine under debug takes a lot of time on Linux: two minutes or more.
Cause
The reason for this is the way how lldb is designed. The most time-consuming part of the process is symbols loading. When lldb starts, it loads modules (Linux - .so, MacOS - .dylib, Windows - .dll), searches for symbols files (Linux - .sym, MacOS - .dsym, Windows - .pdb), read those and build debugging information (symbol tables, line tables, etc..) for further usage. This process takes time, and there is no obvious way on how to speed it up. Unreal Engine is split into around a thousand of modules (dedicated programs and dynamic libraries). Every module has its own symbols file. By default, lldb loads symbols for all the available modules. This is the main problem. There is no need to load all the available symbols: it is slow, and a user usually debugs a limited set of modules. So that the only symbols a user needs are the symbols for these modules.
Resolution
The way to speed debug startup up is to load symbols lazily: load symbols once there is a need for those. It can be achieved by adding
settings set symbols.enable-lldb-index-cache true to the ~/.lldbinit file.
After setting this setting, lldb behaves as follows: lldb loads minimum symbols that are needed to start the session, and it does it fast. When a user starts debugging a specific module (evaluate an expression or place a breakpoint), then lldb loads symbols for that specific module.
Comments
0 comments
Please sign in to leave a comment.