[UE5][Linux] Starting with the LLDB attached is very slow.

Hi, I'm experiencing a really slow startup when I launch the project with the LLDB attached ( I have on-demand symbols enabled already ). As far as I can tell this is not a new problem and it has already been reported multiple times ( RIDER-98057 or RIDER-106035 ). Those reports are old and I wonder if any work is planned soon to solve the issue? 

I've tried to figure out what's going on by profiling the lldb-server during the startup, sadly symbols are not available so I didn't get much from it. After that I decided to replace Rider's lldb binaries with the system ones ( I used a simple ln to do it, not sure if there is a proper way ). I was able to get meaningful profile data with it but something else also happened. To my surprise replacing binaries made the startup time 3.5x faster ( 75s down to 20s ). I'm not really sure what's going on here but I thought it may be worth reporting.

I'm running JetBrains Rider 2024.2, Build #RD-242.20224.401, built on August 14, 2024. Rider's lldb version is 17.0.6 (LLVM; JetBrains IDE bundle; build 273) while mine is 18.1.8. Files I've replaced are lldb, lldb-argdumper, lldb-server and liblldb.so. 

 

[EDIT]

I wonder if this is an issue with an old glibc. In the past to get better startup times we had to change glibc.rtld.dynamic_sort tunable. Since 2.35 it is not required anymore but maybe you are linking to an older version? This is just a random guess based on some discord talk but again I thought it may be useful.

 

 

 

 

 

1
10 comments

Same problem here.

 

BTW, how to check which version lldb is?

0

Hello,

Thank you for contacting Rider support.

JetBrainsBest , please try the following: Open the ~/.lldbinit file and add the row settings set symbols.load-on-demand true (fixed a typo). Save a file and try to start debug again. That should speed debugger startup time noticeably.

Eryk Dykiel , I verified the case you shared (compared Rider bundled lldb with another version (I tried this lldb 18 installed using wget https://apt.llvm.org/llvm.shsudo llvm.sh 18, but didn't get such a (3.5x) performance improvement. 

(note: I made Rider Rider to use standalone lldb installation instead of bundled binaries, using replacing Riders lldb binaries with softlinks, together with lib/liblldb.so)

In fact, using settings set symbols.load-on-demand true (fixed a typo) does speed up the debug startup time by 3.5x (35 seconds against ~110 seconds).

We will discuss and consider whether we want to enable this option by default in RIDER-106035.

Meantime, I would appreciate it if you could elaborate on the way you made your experiment:

  • How did you replace Rider's lldb binaries with system ones;
  • That would be great if you could share a recording that demonstrates your experiment;
  • When you hit a breakpoint in Rider, go to Debugger output( LLDB Console), invoke settings show symbols.load-on-demand and share the output. I suppose you already have this option turned on.

Have a nice day!

0

Hi, Dmitry-Kazantsev

 

Thanks a lot for following issues on Linux!

 

I just tested the option you mentioned, but unfortunately It's basically making no difference for me. I've attached a image to show this.

 

Looks like the option didn't be read.

0

Looks like my image has issues to upload.

State it in text: after enabling and disabling the option, the load time from clicking the green debug button to be able to see the editor window took about 2.5 mins.

0

Hi,

 

After add “settings set symbols.load-on-demand true” rather than “settings show symbols.load-on-demand true”, I got about 2-3 times faster when start debugging.

 

My .lldbinit file:

 

```

settings set target.inline-breakpoint-strategy always

settings set symbols.load-on-demand true

command script import “/home/YOUR_PATH_TO/UnrealEngine/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py”

settings show symbols.load-on-demand

settings show target.inline-breakpoint-strategy

```

 

the “show” command would print the relevant value in “debugger output (LLDB)” window on startup.

 

Thank you a lot!

0

Hello JetBrainsBest ,

Ah, I made a typo, for sure. Take my apologies. I wanted to say settings set symbols.load-on-demand true should be added to ~/.lldbinit. Not settings show symbols.load-on-demand.

You may remove settings show symbols.load-on-demand from the lldbinit file.

Additionally, you might want to try adding this extra setting to .lldbinit: settings set symbols.enable-lldb-index-cache true. As per my tests, it speeds up startup time by 4-7 seconds (not that significantly, but still).

I am glad to hear I was able to help.

Have a nice day!

1

Hi Dmitry, I just tried to reproduce my previous results but with the latest version of Rider ( 2024.2.5 ). When updating to 2024.2.5 I was prompted about conflicting lldb files, previous incremental updates didn't show any popups so I assume something changed this time around on your side. Anyway I did a clean Rider install to make sure results are reliable.  I can no longer reproduce 75s startup, both “stock” rider and modified version ( with lldb replaced ) start in about ~29s. I no longer have the original project so time is not exactly apples to apples. When I originally found the issue I tried going back and forth multiple times and it was very easy to reproduce.

Since I can't reproduce the issue I'm going to skip the recording, given your description I would say you did the exact same thing as me. The only difference was that I compiled my lldb from source locally.

By the way, my original goal with replacing the lldb was to profile it to see what is taking the time. Here is a screenshot from this test ( with replaced lldb because I don't have symbols for the stock version ). Perhaps there is a chance to take it few seconds lower? :D Same project without debugger attached starts in ~15s for me.

 

 

 

0

Hello,

Thank you for the timeline shared. A several-second speedup improvement(3-6 seconds per my tests) might be got by enabling another lldb setting. You might want to give it a try: settings set symbols.enable-lldb-index-cache true (add it to ~/.lldbinit in the same way)

I submitted this another feature request to our tracker: RIDER-118280 Bring lldb-index-cache settings to Rider settings.

Have a nice day!

1

Looks like enable-lldb-index-cache lowers the load time by another ~3s, so down to ~26s, neat. Thanks for pointing it out again, I forgot to check it the last time. 

 

 

0
I am glad to hear that I was able to help.
If there is anything else I can assist you with, please tell me.
0

Please sign in to leave a comment.