4 ms·
Electron is rarely the cause of performance problems itself. It's more that JavaScript makes it really easy to write slow memory bloated code. But it's possibl
by admax88qqq 4y ago
Electron is rarely the cause of performance problems itself. It's more that JavaScript makes it really easy to write slow memory bloated code. But it's possible to write really fast and efficient apps in JS.
There are a few fundamental limitations with web/js. No shared memory concurrency, no reasonable storage layer, no integer types. Those can make some things hard to make performant but most apps I see are not limited by this.
Most apps are slow due to a few common mistakes.
- React/Anglular diff based rendering cycle.
- Garbage collection due to careless allocation of objects in tight loops.
- Poor client side data models, resulting in blocking on the network for simple things.
- Careless use of the bad storage abstractions (bleh indexeddb) which requires copying data for every operation leading to GC pressure and wasted CPU.
- V8 is a moving target in what it chooses to optimize well and what it fails to optimize.
tl;dr fast electron apps are possible but the platform makes it easy to write slow apps by default.