Return to site

Ways to Reduce Speed Issues in Salesforce Lightning

· Salesforce
broken image

Nobody likes stuff that is too slow to takes inordinate time to load. The same is true of users of salesforce lightning. We look at ways to bring down speed issues in salesforce lightning.

Performance profiling- There are numerous tools available to investigate issues of slow lightning components. These include tools such as chrome performance tool or lightning component inspector in Google chrome.

Client side is faster than server side - Remember to keep maximum application logic on the client end. When logic executes in the user’s browser it can respond very quickly to user requests. Logic on the server end at the very minimum has a round trip delay. In a majority of cases you should only use the server side to read or write records as well as metadata.

Utilization of Lightning base components - Rather than reinventing third party lightning components look at base components at the onset. Making custom component and next applying Salesforce lightning design system is not the right step if you already have base component. The latter has lightning design system, enhanced performance with least foot prints as well as best practices.

Avoid delays by doing this - During any prefetch request also return information that the app is just going to display even if it will not be required in all different situations possible. A user experience having no delays is a better option than a slow app which utilizes slightly less bandwidth.

Restrict utilization of JavaScript libraries - This is the right time to learn JavaScript from the ground up. In earlier times there existed only a handful of libraries such as jQuery, underscore JS and few others. But in this continuously and fast changing time of technology there are new libraries as well new versions of existing libraries. Simultaneously vanilla JavaScript has become much more powerful thanks to active releases of ECMAScript. You may be able to do most of the stuff by merging Aura framework with Vanilla JavaScript. $a.util has several valuable methods for Lightning component development.

Get into the habit as well as practice of prefetching to gain speed - In the case of routinely displayed records as well as metadata 'prefetch' it (load it prior to it need to be displayed in the app) in a wrapper instead of gathering the data individually as well as on demand. For instance- if you click on a picklist you desire to instantly be able to view as well as select the available values from a dropdown menu instead of waiting for them to pop up.

Restrict use of Application event - As you are aware there are 2 kinds of events- Component and application events. Application events are pretty powerful and offer plenty of flexibility to communicate between any components in Application. Note that you should utilize Application event with much precaution. An application event is broadcasted to all components at the same time. It may be overkill for certain components if it’s not required. Atocloud.com can reduce speed issues in salesforce lightning for your business’s benefit.