cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Konditoren
Frequent Visitor

Performance optimization - how do components work?

Hi all.

 

I've been doing some research on performance optimization as my app has a very long load-time. A tip that often comes up is the use of components and while the benefits of components changing automatically accross all screens are obvious, rarely do people go in-depth about how the app actually loads and implement these. The common thing to bring up is how they reduce the seen amount of controls in the left-hand tree view, but I'm wondering if this reflects an actual "behind the scenes" reuse of the controls that make up the component.

Say if I have a header component with a logo and rectangle and a label for the screen title like "Home Screen", "Settings" etc. Does the app actually resuse these controls or does it duplicate each and functionally you end up with the same amount of controls only hidden to the developer so to speak?

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Konditoren 

Controls will make your app more manageable and easier to change, but they will not necessarily change load times.  Technically, under the covers, the resultant screens generated will have the same instances as without a control.

 

However, the above statement about manageability and ease of change is a definite plus for components!

 

But, are you actually dealing with so many controls in your app that you feel that it is the performance issue?  If so, then I would consider changing the amount of controls you have and consolidating into better ways - like if you have a long line of buttons, consider putting a single gallery with a single button in it and then have the gallery action determine the button action.

 

Usually, performance issues on load are almost always attributed to datasources.  If you are using collections to collect a full data source (or even just a variable) then you will suffer a lot of performance issues.  Those should be removed and refactored.  Likewise, if you are making lots of "trips" to the datasource in the start of the app, then that should be refactored.  And finally, keep in mind that when an app starts, it renders the controls on the screen.  If those controls have properties in them that are data intensive, then those should be refactored as well.

 

You can definitely use the Monitor tool as @AmeerJab mentioned to get a better idea on what is consuming the time as well.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

4 REPLIES 4
AmeerJab
Resolver I
Resolver I

Hello,

what i would recommend for you to do is you can Monitor your app, while Monitoring your app you can view the time each component took to load.

 

  • you can also go to setting inside your power app
  • then go to Upcoming features
  • go to experimental and scroll down to enhanced performance for hidden controls and enable it 
RandyHayes
Super User
Super User

@Konditoren 

Controls will make your app more manageable and easier to change, but they will not necessarily change load times.  Technically, under the covers, the resultant screens generated will have the same instances as without a control.

 

However, the above statement about manageability and ease of change is a definite plus for components!

 

But, are you actually dealing with so many controls in your app that you feel that it is the performance issue?  If so, then I would consider changing the amount of controls you have and consolidating into better ways - like if you have a long line of buttons, consider putting a single gallery with a single button in it and then have the gallery action determine the button action.

 

Usually, performance issues on load are almost always attributed to datasources.  If you are using collections to collect a full data source (or even just a variable) then you will suffer a lot of performance issues.  Those should be removed and refactored.  Likewise, if you are making lots of "trips" to the datasource in the start of the app, then that should be refactored.  And finally, keep in mind that when an app starts, it renders the controls on the screen.  If those controls have properties in them that are data intensive, then those should be refactored as well.

 

You can definitely use the Monitor tool as @AmeerJab mentioned to get a better idea on what is consuming the time as well.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Hi, thank you for the reply. You too @AmeerJab . I used the monitor tool and concluded that issue is not primarly the amount of components, but for some reason it calls a bunch of random lookups. These might be triggered somehow by cross-screen dependencies or something, but I'm not too sure. Details here https://powerusers.microsoft.com/t5/Building-Power-Apps/Weird-onstart-behaviour-causing-extremely-sl...

RandyHayes
Super User
Super User

@Konditoren 

Yes, this is very common in the app if you have datasource formulas in controls - which is preferred, but must be used properly to not cause extensive start up time or screen render time.

What you have to realize is that PowerApps is just like Excel - all controls derive from other controls if the formulas in them state to do so.

So an example of a bad scenario is if you have a Gallery that derives some property of another control in order to determine its Items (like a dropdown that is used in a Filter in the Gallery Items).  YET, on the dropdown, there is some other formula that changes the dropdown value by some way, then the Gallery will re-evaluate the Items property again.  So that can be hit after hit to the datasource and can be slow depending on the complexity.

Also, and collect statements or other gathering from the datasource can slow down the start.

 

Glad you are able to start narrowing it down.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,054)