Reply to “Electron is flash for the desktop“ by Joseph Gentle
If you haven’t read his blogpost on Electron being the Flash of desktop, you should read it now. You can find it here.
In his article, Joseph Gentle criticize Electron apps for having a lot of overhead because they run on top of the Chrome runtime which is known for being a little too comfortable with your computer’s resources, and which Gentle compares to a fully fledged operating system; something which is in many ways true.
While Gentle was unhappy with the amount of disk-space Electron apps use, his main problem was the inane memory usage illustrated with Slack’s usage as an example.
While 1GB is a lot of memory, it’s important, however, to compare Electron apps’ resource usage with similar apps that don’t use Electron.
If we look at Microsoft Word’s memory usage which is rather low compared Slack with its 85 MB with an empty window, and 140MB when a 15 MB document filled with text and images is opened (the document text doesn’t have any special formatting).
As Microsoft Word isn’t based on Electron, these findings seem to support the idea that Electron apps, and specifically apps that use the Chrome runtime do patently use more memory than their counterparts.
While Textdown doesn’t consume as much memory as similar apps, it uses a sizable chunk of disk space of 110 MB, compared to the mere 30 MB of Sublime Text 3. The overflooding of disk space becomes even more painstakingly apparent when considering that Sublime Text has an ocean of functionality
It should be noted that Joseph Gentle’s article was from late October 2016, and it’s entirely possible that Electron, and Chrome, has improved since then, and is what is causing the low memory usage of my test application. How much it has improved is still unclear as Spotify still eats a healthy 600 MB which is 3 times more than what Gentle found.
Ultimately, I think Gentle is somewhat correct; modern apps take use a lot of memory due to the vast frameworks on which they are built. Sure, the frameworks help developers spit out apps faster, and easier than if they had developed them without the huge frameworks, but it shouldn’t be an excuse for not optimizing applications; which it has increasingly become because memory is cheap, right?
However, Electron and Chrome are not completely to blame. As shown Electron apps can also be memory efficient just as non-Electron apps can eat memory as if it was Google Chrome.
Other large frameworks, and lazy programmers can also steal a system’s resources, so the solution is not to just stop using Electron, but becoming aware of the need for lean and fast applications, and the supercomputer in our pockets is not a permit to stop caring about efficiency.
Consequently, if you install an older operating system on a modern computer, and run some of the applications from that era; the era before applications were called apps, you will (re-)discover how snappy everything is. Let’s aim for a similar performance for the apps we use today. Let’s aim for not having to wait 5 seconds for Microsoft Word to load on a fast SSD. Let’s aim for not letting applications needlessly clog a user’s hard drive.
Addendum: As I have been holding off installing Electron apps such as the Discord client because I don’t like the idea of having yet another Chrome runtime running on my computer, I must admit that most Electron applications are more likely to use a lot of memory and disk space, than applications that don’t ship the entire Chromium runtime.