Author Topic: Lazarus 2.2 seems to be a lot slower loading a form than Lazarus 1.4.4  (Read 3745 times)


  • Administrator
  • Hero Member
  • *
  • Posts: 8095
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus 2.2 seems to be a lot slower loading a form than Lazarus 1.4.4
« Reply #15 on: January 14, 2022, 12:27:22 pm »
Well, it's  hard to say what exactly happens in your case. I couldn't reproduce it (nor do I currently have the time to go debugging it).

It could be that it wraps more than once. Unless your code does something that forces this, that would be something I consider "should not happen".
But it could be other stuff too.

If you are interested in it...

You could set breakpoints ( lcl\interfaces\win32\*  TWin32WSMemo / TWin32MemoStrings  )
- find where wordwrap start/ends (not sure, it may be done in the Windows kernel).
- Find when / from where / how often, the handle is created (and/or released).
- Find where (lcl/include/windows) the text is "set" (handed to the Windows API).
- What other API calls are done, and how long they take.

When you found where the time goes, find which line in your code triggers it. And if there are conditions, like checking for an existing handle, or visibility.

I am not sure, but I expect OnShowForm to be called, when it is made visible. That would mean, that at this time a lot has already been done:
- the handle(s) are created
- the size are set (therefore, maybe some of the time is spent before OnShowForm even happens)
- auto-layout, if needed may have been done

A framework like the LCL needs to do a lot under the hood....


TinyPortal © 2005-2018