Electron's Performance checklist is an excellent resource for strategies to optimize your application. The document outlines various ways to reduce the amount of memory, CPU and disk resources being used while ensuring the app remains as responsive as possible.
Measure, Measure, Measure
The checklist below is a great starting point for steps that are straightforward and relatively easy to implement but building the most performant version of your app will probably require going above this checklist. Instead, you will have to carefully examine all the code running in your app by profiling.
It's been found that the most successful strategy for building a performant app on Electron is to profile the running code, find the most resource hungry part, and to optimize that part.
To learn more about how to profile your app's code, familiarize yourself with the Chrome Developer Tools. For advanced analysis looking at multiple processes at once, consider the Chrome Tracing tool.
- Carelessly including modules
- Loading and running code too soon
- Blocking the main process
- Blocking the renderer process
- Unnecessary polyfills
- Unnecessary or blocking network requests
- Bundle your code