Delivering an application by implementing the required functionalities only is not the only thing a development team should focus on. The application should be usable and fast enough, so that end users can finish their work within time.
The application performance is the very important factor for the success of any application delivery.
Here, in this article, I am going to share my experience with one of our client where the application was in a very bad state and there were a lot of performance issues.
Performance issues are very difficult to resolve, especially when some other vendor has developed and now you are going to resolve it without knowing why it has been written in this way 😀
Now, you know your application has performance issues. The questions is, from where do you start?
You will get the input from the client that some or many functionalities are working slow. Also, if you have configured the PDC, you will get the PDC alerts as well.
As a lead, first talk to the business and get the list of pain areas. You need to ask for end users expectations that how much amount of time a particular action or functionality should take . Now you know the functionalities which are working quite slow.
At the same time, analyze the PDC alerts as well. You might get some quick win solutions.
The pain areas could be…
- Case screen taking long time to load.
- Save/Submit actions taking longer than expected time.
- Business Reports taking longer time to show the results.
- Screen getting stuck completely.
- User actions taking longer time to execute.
Once you finalize the list of pain areas, prioritize them. You can have a discussion with business and decide the priority.
Before you jump on to the solution, you need to go though the rules line by line. Understand what is written and try to get the motive.
Get in touch with the business to understand the functionalities.
Once you start digging into the code, you will start realizing the problem areas.
You need to do this practice for all the pain areas.
Below are some of the improvement areas on which we worked to solve the performance problems to the great extent. These actions seems to be simple, but it requires a lot of investigation.
- Add database indexes wherever required. Adding DB Index greatly improves the performance.
- Expose properties which you need for reporting purpose.
- If your application has huge volume of cases or data, consider archiving the data. It will surely improve the load time.
- Avoid repetitive loops. If you have a pagelist and you want to perform multiple actions on it, do it within one loop only. Looping through same list again and again is not going to help you. It will also make your code very hard to maintain.
- Avoid loop within loop. Instead use OOTB functions like IndexInPageList & IsInPageList wherever required. Loop within loop without any strong reason is a immature practice.
- Do not commit for each change. Instead go with Deferred Save. And commit at the end. Unnecessary commits will introduce a lot of stability issues as you might lose the lock.
- Avoid unnecessary API calls. If you are hitting the API again and again to fetch the same set of data, then you are putting your application in bad state. Also, more API hit means increased load on the service. Use DataPage as a source for connector. Make sure you are not passing new parameters as it will not look for the cached data and will make a separate API call. Also, do not remove the DataPage without finishing your reequipment.
- Defer loading some of the UI items. If your UI is very complex and you are showing a lot of things, then your UI will take a long time. Just have a discussion with client and get to know the important things which should be loaded when the case is opened. Other data you can defer load. It could happen when you open a tab or you expand a Dynamic Layout or you might configure this action on a button click.
- Follow modular approach. Write smaller, reusable rules. Avoid complicating them by putting unnecessary things at one place.
- Check any PDC alerts and follow the suggestions.
- If the APIs are working slow, get in touch with the API team and look for solutions from their end. You also need to consider the network latency or any other processing time time which is making the API calls slow. It might be related to the Authentication as well.
- Rewrite the rules. Some times, its better to rewrite the things instead of correcting the existing things. If you know what you are doing, just go ahead with that.
You need to understand one thing, only resolving these performance issue is one part. You will also need to showcase the amount by which you have improved the performance. And for this PAL readings will help you.
You can take the before and after reading for the functionalities and showcase it to the client saying that the application is now faster and its saving this much amount of time.
I hope this article will help you to get some idea on how we can tackle the performance issues.
If you have any thoughts on performance issues or any point which will improve the performance, please do let me know in the comments.
Thanks for reading this article.