The code we write will be executed a lot of times by lot of users and it has direct impact on the performance. It should be very efficient and optimized. Using best practices like the below during the development will surely help in improving the performance
- Make Fewer HTTP Requests:
If the HTTP requests are more, it takes more time for the browser to process them. So, it will be a good practice to reduce the number of such requests in the page load.
For Example: May be there are some calls happening on page for some plugins which are not even required for loading. Or there could be scenarios where user profile is being called more than once, which will result in more http requests.
This is process which will combine multiple small JS files in a single JS file and in turn reduce the number of http requests. Example: There could be multiple JS files that are used for different web parts on the sites, it can be bundled together.
When referencing resources from external systems, it important to test if that resource path is reliable or not. Each of resource not available 404 error is very costly and impacts performance.