PL 400: Optimize app performance including pre-loading data and query delegation(Manage and troubleshoot apps)
Certainly, canvas apps provide a platform where anyone can design/develop apps. They have to drag and drop controls on a blank canvas app visual tool and design a user interface. Building apps with PowerApps makes everyone from business analysts to professional developers work together more efficiently.
When solving business problem with intuitive visual tools, performance is the key factor that determines the success or failure of apps. App performance indicates how the app is working and how the app is responding to the end user.
- Load Data
- Query Delegation
- Local Caching
- Concurrent Calls
- Delayed Load
- Formula Optimization
- File Optimization
- Connector Limits
- Control Optimization and Dependency
Load Data:
Generally, data is the soul of the app, but additional data load or communication with data sources always poses challenges to the performance of the app. For better performance, canvas app makers like to preload multiple tables and entities during the state of their app. This feature dramatically enhances performance.
- Setting global variables e.g. For the colors and other repeatable that will be used throughout the app
- Get and store records in a collection e.g. for offline capabilities
Query Delegation:
Query delegation is a name power apps ability to delegate the processing of queries to the underlying data source instead of processing them locally in memory. A delegable power apps can improve query performance drastically and work with large datasets.
Few points need to know about this feature:
- This is not default feature, It need to configure in Advance Setting Option.
- Default limit for non-delegable queries is 500.
- Only below data sources are supported the delegation
- Microsoft Dataverse
- SharePoint
- SQL Server
- Imported Excel files (static), collection and tables store in variables , therefore those don't need to delegate.
- Every Data source is different and its associated delegable functions vary based on the data sources.
- Filter, Search and Lookup functions are delegable functions.
Local Caching:
Cache is reserved storage space that collects temporary data to help apps load faster. This makes it easy to retrieve data quickly which in turn helps the device run faster.
There are two type of caching :
Local Caching : It is cache data in the memory space.
Distributed Caching: It is an independent process and is generally deployed on different machine.
The use of local caching in the canvas app reduces repetitive calls to data sources across the network. ClearCollect function helps to cache data locally if it does not change during user session. Use the Set function to cache data from view tables locally to avoid returning data repeatedly from sources.
Concurrent Calls:
The idea of concurrent calls is based around a user having access to more than one call at a time. The concurrent function evaluates multiple formulas at the same time. Generally, several formulas are evaluated by chaining them simultaneously at the same time ; operator that evaluates each one sequentially. When the app operates concurrently, users wait less for the same result.
Sequentially Call:
Concurrent Call:
Delayed Load:
Delayed load is one of the features that preview mode still has, but it does have a significant impact on app performance. This setting is enabled by default and if we disable it then an app will load all screen and data controls on startup. This prevents apps from pre-loading screens that a user does not open. Microsoft recommends that if the app has more than 10 screens, no rules, and multiple controls that span multiple screens and are tied directly to the data source. If we build this type of app and do not enable this feature, the performance of the app may be affected as the controls in all the screens must be populated even on the screens that are not open.
Formula Optimization:
A formula is an expression used in an app to perform an action or a mathematical operation at a specific value. This helps create a more interactive and dynamic user experience in the Canvas app, but excessive use of formulas significantly impacts app performance, so Microsoft recommends optimizing the use of formulas. In this way, we can use the below exercises to improve the performance.
- Avoid repeating the same formula in multiple places
- Avoid using Form.updates in rules and formula
- Use first filter rather than lookup function
- Use concurrent function to run formula parallel, if they don't depend on each other.
- Use the variable as result instead of runtime formulas.
Comments
Post a Comment