Lazarus

Programming => LCL => Topic started by: Heinz on October 18, 2021, 05:11:41 pm

Title: Too many components and code
Post by: Heinz on October 18, 2021, 05:11:41 pm
If a unit is full of components and so, also full of code it will slow a lot the application?
It is running smooth right now but I'm looking to add a lot of PopUpMenu, each with a different menu.
Which is the right track to avoid slowing down the application with a lot of components / functions / procedures?
Title: Re: Too many components and code
Post by: jamie on October 18, 2021, 05:18:34 pm
If a unit is full of components and so, also full of code it will slow a lot the application?
It is running smooth right now but I'm looking to add a lot of PopUpMenu, each with a different menu.
Which is the right track to avoid slowing down the application with a lot of components / functions / procedures?

That will not slow down unless you start hitting your process memory limits then maybe the swap file in your OS could start interacting more often.

you could run out of memory per process but you will know that while you are DEV your app.

What will slow down things is if you build a lot functions doing simple things where it could be done inline as you code. Function calling has a little overhead to it so it takes a few CPU cycles to prep the call and return from the call.

I wanted to add that having a lot of components that need to stream some properties could cause a little slowness during initial startup because it has to be read from file.

TinyPortal © 2005-2018