Recent

Author Topic: Very slow program launch.  (Read 967 times)

Prime

  • Jr. Member
  • **
  • Posts: 62
Very slow program launch.
« on: March 16, 2023, 08:45:44 pm »
Hi All,

I have a fairly complex application that I am in the process of trying to port from Delphi 7. I have my application mostly running......
However if I try and lanch my app from within the IDE it takes 20+ seconds for the main window to appear (even if I run my app having made no code changes).
If it has to compile this only takes 2-3 seconds and outputs progress so I can see it's working. The launch almost appears to have hung.

If I run from windows the app launches almost immediately.

Application files (and Lazarus / FPC), are installed on local SSD drives so network access shouldn't be an issue.

I'm running Lazarus 2.26/FPC 3.2.2 X64 on Windows 10 x64.

Cheers.

Phill.

bobby100

  • Full Member
  • ***
  • Posts: 164
    • Malzilla
Re: Very slow program launch.
« Reply #1 on: March 16, 2023, 09:26:28 pm »
Try Run > Run without Debugging and see if it makes any changes. I guess it is much slower because of the debugger.
https://gitlab.com/bobby100 - my Lazarus components and units
https://sourceforge.net/u/boban_spasic/profile/ - my open source apps

https://malzilla.org/ - remainder at my previous life as a web security expert

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9908
  • Debugger - SynEdit - and more
    • wiki
Re: Very slow program launch.
« Reply #2 on: March 16, 2023, 09:37:44 pm »
The next question is "which debugger".

The IDE has several. On Windows there are 2 debuggers commonly used.
Menu: Tools > Options > Debugger > Debugger backend.
Check  for FpDebug or GDB.

Try the other one, to see if it matters.

In gdb, you can "DisableLoadDebugInfoForLibraries" (in the property grid, on the debugger option page). If you use many libraries, and they have all debug info, then this may speed things up.

Having said that, starting the IDE itself in the debugger (either of the 2) takes less time than you experience. So I wonder how much "fairly complex" is.

Prime

  • Jr. Member
  • **
  • Posts: 62
Re: Very slow program launch.
« Reply #3 on: March 16, 2023, 11:02:31 pm »
Hi all,

I changed the debugger from gdb to FpDebug internal dwarf and it's launching much faster, couple of seconds after compile finishes.

Cheers.

Phill.

balazsszekely

  • Guest
Re: Very slow program launch.
« Reply #4 on: March 17, 2023, 06:25:22 am »
@Prime
Also add Lazarus, FPC and your project folder to exclusion list(All Settings->Virus&threat protection->Manage Settings->Add or remove exclusion).
It will run much faster.

 

TinyPortal © 2005-2018