Recent

Author Topic: [Solved] How to speed up OpenDialog in the IDE  (Read 1485 times)

bobonwhidbey

  • Hero Member
  • *****
  • Posts: 592
    • Double Dummy Solver - free download
[Solved] How to speed up OpenDialog in the IDE
« on: January 27, 2020, 06:40:44 pm »
I've learned that the OpenDialog command, when encountered during debugging in the IDE, seems painfully slow. When run outside the IDE, whether the EXE is stripped or not, OpenDialog is rapid. Is there a way, perhaps like a Command Line Parameter to turn off debug info for a portion of a file. This doesn't work, but you might get the idea.

Code: Pascal  [Select][+][-]
  1. {$G-}
  2. if OpenDialog1.Execute then begin
  3. .
  4. .
  5. end;
  6. {$G+}
  7.  
Is there some way to speed up this process in the IDE?
« Last Edit: January 27, 2020, 11:05:48 pm by bobonwhidbey »
Lazarus 3.0RC2, FPC 3.2.2 x86_64-win64-win32/win64

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: How to speed up OpenDialog in the IDE
« Reply #1 on: January 27, 2020, 07:02:02 pm »
You can try https://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#gdb.exe_has_stopped_working
 "DisableLoadSymbolsForLibraries" to "True"

You may also want to try a newer gdb.
On our Sourceforge page, under both Win32 and Win64 is a section "Alternative GDB".
GDB 8.2 should work.

bobonwhidbey

  • Hero Member
  • *****
  • Posts: 592
    • Double Dummy Solver - free download
Re: How to speed up OpenDialog in the IDE
« Reply #2 on: January 27, 2020, 07:26:33 pm »
I downloaded gdb 8.2 and placed it in this folder (after first renaming the original gdb.exe)
C:\lazarus\mingw\i386-win32\bin

This reduced the time for OpenDialog from 17 seconds down to 13.5 seconds.  Still a long time to wait for an impatient programmer. :(

Second and subsequent issuing of the OpenDialog command in my program, whether new or old GBD, were about 2 seconds- the same time as I experience outside the IDE.

I'm hoping there's a better approach as this is still extremely slow IMO.
Lazarus 3.0RC2, FPC 3.2.2 x86_64-win64-win32/win64

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: How to speed up OpenDialog in the IDE
« Reply #3 on: January 27, 2020, 09:29:16 pm »
Have you tried the DisableLoadSymbolsForLibraries?

The open/save dialog loads a big amount of dll. (win32/64)

The exact amount depends on other stuff installed on your PC.
E.g., If you have tortoise svn/git installed they install so called "shell handlers", allowing them to add icon overlays, or special context sensitive pop-up menu entries.
A lot of apps on windows do that (image viewers, pdf viewers, editors, some offices ....).

All of those are dll, and because the open/save dialogs are basically a "windows explorer", all of those dll are loaded.

If gdb sees a dll being loaded, gdb inspects the dll. That takes time.
=> AFAIK that is the main slowdown.

I have never tested, if disabling the event log for loaded libraries/modules has any effect on this delay. Tools > option > debugger > event log


bobonwhidbey

  • Hero Member
  • *****
  • Posts: 592
    • Double Dummy Solver - free download
Re: How to speed up OpenDialog in the IDE
« Reply #4 on: January 27, 2020, 10:50:19 pm »
SIGNIFICANT IMPROVEMENT

I set DisableLoadSymbolsForLibraries to true.  It was in Tools>Options>Debugger>General

The initial OpenDialog took 5 seconds (down from 17). Subsequent OpenDialog executions took about 2 seconds or a little less, as usual.

I'm back to using the old GDB.exe. I tired both old and new GDB and both took 5 seconds for the first attempt after setting DisableLoadSymbolsForLibraries to true.

Can you think of any way to get this down to 2 seconds?

Thank you Martin
Lazarus 3.0RC2, FPC 3.2.2 x86_64-win64-win32/win64

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: How to speed up OpenDialog in the IDE
« Reply #5 on: January 27, 2020, 10:59:38 pm »
Can you think of any way to get this down to 2 seconds?

Not from the top of my head....

GDB will be signalled by Windows for each dll.

I do not know if there is a way to reduce the amount of dll that will be loaded (other than uninstalling, which is not an option)

I have no knowledge how the time lost per dll is distributed.
You could look in gdb, if you can suppress the message that is emitted for each dll. Not sure if wort it.
Maybe it is enough to disable them in the IDE event log config, but I highly doubt that will bring much.



If it is a real bother, try FpDebug.
It does way less for loaded dll. So it probably be faster on that. (but no promises....)

But in 2.0.6 it is still missing various fixes. In 2.1 (svn) it is a usable beta (at least works well for me).

https://wiki.lazarus.freepascal.org/FpDebug#Installation_in_the_IDE
(and change the debugger config, in tools > options)

 

TinyPortal © 2005-2018