Recent

Author Topic: IDE unnecessarily draws all forms when opening a project  (Read 691 times)

Aidex

  • Jr. Member
  • **
  • Posts: 54
IDE unnecessarily draws all forms when opening a project
« on: July 04, 2020, 11:01:34 am »
I use Laz v2.0.8 on Windows 10 (64) on a fast PC.

When opening a project in the IDE, all forms of my project are displayed.
My project has about 50 forms and therefore it takes several seconds to display them, which annoys me.
After loading, I have to minimize the IDE once to get rid of all the unwanted forms garbage from my screen.
Is there a setting which suppresses the drawing of the forms during loading?

Rarely it even happens that the IDE gets caught in an endless loop when opening the project while displaying all forms and units. I have to shoot the IDE down then and try again. I also had this problem in earlier Lazarus versions.

When closing a project it is unnecessary to redraw each closing tab individually. With my about 150 opened units, redrawing each unit tab when closing it is at least unnecessary.

But my biggest problem is the above mentioned display of all forms when opening.
I would be happy if there would be a solution for this (in the future).

Thaddy

  • Hero Member
  • *****
  • Posts: 10294
Re: IDE unnecessarily draws all forms when opening a project
« Reply #1 on: July 04, 2020, 11:06:51 am »
Try another language....same problem...
I am more like donkey than shrek

Aidex

  • Jr. Member
  • **
  • Posts: 54
Re: IDE unnecessarily draws all forms when opening a project
« Reply #2 on: July 04, 2020, 11:15:34 am »
Maybe I left the smilies in my post.  :D
Of course I am very happy with Lazarus and I am glad that Lazarus exists!  :)
This morning I had to shoot the IDE several times because it got into an endless loop while loading. That was a bit sobering. Therefore my post.
Have a nice day everyone!  :)
« Last Edit: July 04, 2020, 11:19:15 am by Aidex »

howardpc

  • Hero Member
  • *****
  • Posts: 3490
Re: IDE unnecessarily draws all forms when opening a project
« Reply #3 on: July 04, 2020, 11:37:03 am »
How many of your project's 50 forms are autocreated?
How many need to be visible throughout the time the project runs?
Maybe you could redesign the project so that only your main form is autocreated, and all other forms are created as needed, and then freed (or minimised or hidden if you prefer). This would certainly help with runtime behaviour. Whether it helps at design time I'm not sure. I never had to develop a project that needed 50 forms.
However, think about Lazarus itself, which potentially can show literally hundreds of forms and dialogs. Not only does it load faster than almost any other IDE I know, but it remains responsive. And you can debug the IDE without having to wait for scores of forms to load.

Aidex

  • Jr. Member
  • **
  • Posts: 54
Re: IDE unnecessarily draws all forms when opening a project
« Reply #4 on: July 04, 2020, 11:44:49 am »
Yes, I've already done that. Most of the forms are only created at runtime when they should actually be displayed!
But this does not change the fact that the forms are still loaded into the designer (at design time). Because of me, the designer would not need to draw/display all forms when opening the project in the IDE.
« Last Edit: July 04, 2020, 11:46:41 am by Aidex »

Zoran

  • Hero Member
  • *****
  • Posts: 1575
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: IDE unnecessarily draws all forms when opening a project
« Reply #5 on: July 04, 2020, 05:07:51 pm »
Yes, I've already done that. Most of the forms are only created at runtime when they should actually be displayed!
But this does not change the fact that the forms are still loaded into the designer (at design time). Because of me, the designer would not need to draw/display all forms when opening the project in the IDE.

Do not keep all project units open in source editor.
Close one by one units which you are not currently working on. Leave only several units open. Save the project.
When you open this project again in the IDE, only these several units (and the forms which are tied to these units) will load.
When you need to open another unit, open it and work in it.
So, try to always close the unit in the editor when you don't need it open at the moment. Open it again when you need it.

wp

  • Hero Member
  • *****
  • Posts: 7391
Re: IDE unnecessarily draws all forms when opening a project
« Reply #6 on: July 04, 2020, 06:46:08 pm »
Rarely it even happens that the IDE gets caught in an endless loop when opening the project while displaying all forms and units. I have to shoot the IDE down then and try again. I also had this problem in earlier Lazarus versions.
When I worked with the LazStats application I had some 30 forms open, but never had seen such an issue. I think this is an indication that something is wrong in your project. Maybe an interdependence of two (or more) forms which only can be resolved when the related forms are open or are opened in the correct order.

For working with many forms, I configured the IDE editor such that the editor tabs are at the left ("Tools" > "Options" > "Editor" > "Pages and Windows": "Source notebook tabs position" = "left", and I also check "Multipline tabs" on the same page. This way more forms are ready for usage than in the standard horizontal tab arrangement. But note: this does not work in all widget sets.

Another useful preparation is to have the Project Inspector open all the time - I usually drag it to the right of the screen. Here I can access every unit of the project by a simple double click.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3809
  • I like bugs.
Re: IDE unnecessarily draws all forms when opening a project
« Reply #7 on: July 04, 2020, 11:39:15 pm »
I use Laz v2.0.8 on Windows 10 (64) on a fast PC.

When opening a project in the IDE, all forms of my project are displayed.
My project has about 50 forms and therefore it takes several seconds to display them, which annoys me.
After loading, I have to minimize the IDE once to get rid of all the unwanted forms garbage from my screen.
Is there a setting which suppresses the drawing of the forms during loading?
Do you have the Sparta docked form editor installed?
Several seconds sounds like a long loading time for the forms, true. An optimization could be implemented to load a form only when its editor page becomes active. AFAIK now there is no such optimization.

Quote
Rarely it even happens that the IDE gets caught in an endless loop when opening the project while displaying all forms and units. I have to shoot the IDE down then and try again. I also had this problem in earlier Lazarus versions.
That is bad. Can you copy your project and Lazarus session to test and reproduce the problem? At least I can promise not to copy it forward in case it is closed source.

Quote
When closing a project it is unnecessary to redraw each closing tab individually. With my about 150 opened units, redrawing each unit tab when closing it is at least unnecessary.
Redrawing each tab while closing a project is useless indeed. Should be optimized.
For me it happens so snappily that I didn't pay attention.
Mostly Lazarus trunk on Manjaro Linux.

Aidex

  • Jr. Member
  • **
  • Posts: 54
Re: IDE unnecessarily draws all forms when opening a project
« Reply #8 on: July 05, 2020, 09:28:46 am »
Thank you for all your answers!  :)
I share the assumption that the endless loop during loading is caused by dependent forms! The project uses a lot of TFrames, sometimes frames within frames placed on a form.

The project is 17 years old and was converted from Delphi 7. Today we would solve many things differently, but the old project is too complex and too old for fundamental changes. I am not allowed to send the source code.

Regardless of the old project, the endless loading loop of the IDE (displaying thousands of forms again and again) is a bug. Fortunately, it occurs only occasionally.
I only use a pure Lazarus installation (installer from your website), without any external components! With every new Lazarus version I delete all old settings, so that I can exclude any external influence.

But as long as I am the only known user with this problem, it can be ignored. I can handle it.  8)
Have a nice weekend!
« Last Edit: July 05, 2020, 09:44:19 am by Aidex »

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3809
  • I like bugs.
Re: IDE unnecessarily draws all forms when opening a project
« Reply #9 on: July 05, 2020, 10:06:52 am »
If you could reproduce the loop with a demo project with enough nested frames, then you could report it in bug tracker.
Mostly Lazarus trunk on Manjaro Linux.

 

TinyPortal © 2005-2018