Electron memory usage compared to other cross-platform frameworks

Electron is everywhere you look these days. As a developer seeking to build cross-platform apps, it’s very appealing. It’s free, easy to use and quick to develop with. It’s a very fast way to get an MVP (minimal viable product) to market. On the other hand, a lot of programmers who are smarter than me have a real issue with it.

Every time Electron is mentioned online, you’ll invariably hear the opinion that Electron apps use 300+ MB of RAM and run like a dog floundering in molasses. “Why can’t people write native apps anymore?” the coding elite cry. Maybe the people who make these comments have a point. Native is surely faster than javascript running in a browser instance. But just how much faster?

I decided it would be fun to compare a few different cross-platform approaches and see how they stack up, memory wise. The results had a few surprises.

I created a simple ‘hello world’ app across the various frameworks, with one slight twist – hello world would be an html string <h1>hello world!</h1>, so any given app would need to be able to render HTML. I based this off the Electron quick start app.

I am not a scientist.
I simply used task manager to check the RAM. Your mileage may vary.
HelloWorld is hardly a good real world test, but I don’t have time to write a full app in each framework.
If I removed the HTML requirement and just went with plain-text, the non-javascript frameworks might be leaner, but there are plenty of real-world use-cases for displaying HTML in an app.

Please don’t treat this post as a serious study – it’s just one programmer’s experiment.

 HelloWorld <H1> App
(Ordered from lowest to highest RAM usage)

Tech Processes Total RAM
Xojo 1 12MB
Xamarin.Forms/C# 1 20.3MB
Python/Qt 1 20.8MB
Java 1 24.9MB
NW.js 5 55.3MB
qbrt/HTML 2 59.6MB
ReactNative 1 65.6MB
Electron 5 68.9MB

Xojo – Based on a proprietary version of BASIC, Xojo can target macOS, Microsoft Windows, Linux, iOS, the Web and Raspberry Pi. I’d heard of it a couple of times, but never played around with it until I decided to do this comparison. It’s got the lowest RAM usage of any of the tested frameworks. Unfortunately, it’s not free – it starts at $299 for a licence to build desktop apps (macOS, linux, windows). Every other cross-platform framework on this list is free to use. Also, since installing the framework my phone browsing is now plagued by ads for Xojo. It could be a coincidence, but it seems unlikely.

Xamarin.Forms/C# – Microsoft’s cross-platform framework runs on Windows 10, MacOS, Android, iOS, and Windows Phone. It’s free, and memory usage is great at 20.3MB, although some of that could be hidden behind the UWP processes which are embedded within Windows 10. For this reason it’s difficult to say exactly how much RAM is really being used. That said, I did build the same app out in WPF, and the RAM usage was very similar, so maybe it is reported accurately. If we give it the benefit of the doubt Xamarin.Forms has the lowest RAM usage of any free cross-platform framework. Just bear in mind it can’t be used on older versions of windows.

Python/Qt – often touted as a preferred alternative to Electron, and you can see why. 20.8MB is pretty effective, just a fraction more RAM in this test than Xamarin or Xojo. However, I’ve heard grumblings about Qt licencing.

Java – it’s been years since I wrote any java, but it came back easily enough. A simple JEditorPane inside a JPanel allows me to render our HTML. Java does very well, holding steady at 24.8MB. Java is a very accessible and proven programming language, and being the development language of android apps has given it a massive boost in popularity lately. You don’t have to look far to find resources to learn Java

NW.js – NW.js is pretty much the same thing as Electron. it uses Chromium, but it has one handy feature that the apps can be distributed WITHOUT the runtime, which reduces file size considerably. NW.js used 55.3MB in testing to render our index.html. This is a big jump from Java – more than double the RAM.

qbrt/HTML – This was my first big surprise. I’d never heard of qbrt before researching this post. It’s a little known project by Mozilla engineer Myk Melez. It replaces a previous project, Positron, which was a Mozilla Gecko based Electron alternative, which maintained compatibility with Electron. That project has now been discontinued, and qbrt is the replacement. It’s in the very early stages, not ready for production, but it is worth keeping an eye on. Firefox is enjoying a lot of performance improvements lately, thanks in part to a rewrite in Rust, and these improvements could eventually lead to something which runs leaner than Electron with the same speed of development.

ReactNative (for Windows) – The biggest surprise of my testing was that ReactNative for Windows used only slightly less RAM than Electron to show a simple hello world. 65.5MB was used. ReactNative is often touted as a much better way to write cross-platform apps using JavaScript. Granted, this app included React where the others did not, but React-native requires React. If you were to add React to Electron the RAM would probably go up, but of course you don’t need react in Electron, or any of the other alternatives on here.

Electron – The Electron quick start app is already <h1>hello world!</h1>. All I did was remove the code that checks for version, though I doubt that had any effect. 68.9MB used, across 3 Electron processes and 2 node.exe processes. It’s not exactly a 300MB hog, but it is more than twice the RAM usage of Java and three times that of Python.

Just for fun, here’s the memory usage of that same index.html in all the various browsers I could think of

Browser Processes RAM
IE11 1 20.7MB
Chrome 5 82MB
Microsoft Edge 4 139.5MB
Opera 7 146.3MB
Firefox 1 160MB
Vivaldi 7 244.9MB

I was very surprised to see chrome’s memory usage so low, since it is often called a memory “hog” next to the others. In fact, only IE11 bested it on memory (another surprise). But this is not a test of browsers, I just thought it was an interesting comparison to the above frameworks.

By these tests, Electron is fairly deserving of its reputation as a memory hog. This is no surprise I guess. What may be a surprise is that:
1) ReactNative is not any better and
2) Xamarin.Forms apparently uses less memory than Python/Qt

When Electron gets called out, it is often compared unfavourably to a browser running the same app. The Slack app, it is claimed, uses more RAM than simply running Slack in the browser. However, in my tests, Electron used less RAM to display the hello world HTML than even the leanest Chromium based browser. It’s all academic really – if you fire up a browser to use Slack, it might use more RAM than the dedicated app – but the chances are good that you’ll have other tabs open. If every tab you have open in your browser right now was an Electron app, you’d have no RAM left at all.

The thing about Electron is, there’s a time and a place for it.
VSCode is an excellent use case – a complex cross-platform IDE with a very quick release cycle, a large plugin ecosystem and a requirement for display and processing of a lot of different types of markup. But I’ve also seen a tray notification app built in Electron. An SD-card formatter. A “quick” launcher. These things can and should be built using Xamarin, or Python or Java instead.

This is just a surface comparison of course. Memory isn’t everything. There are so many more reasons why you might choose one framework over another. Ease of use. Familiarity. Toolset / IDE. Licensing. But Electron discussions almost always come down to memory, and that’s why I wanted to write this post in the first place. I’d love to re-visit these frameworks in more depth in a future post, and maybe add a few more to the list.

Some fun Raspberry Pi projects

I’ve got a spare Raspberry Pi Zero W sitting on my desk doing nothing, so today I decided to go looking for fun, easy Pi projects. Here’s a few I found which are a little different from the usual media player / arcade emulator / door opener projects you see all over the place.

Desk Projects

If you have a spare pi in your drawer but don’t want to leave the cubicle, these little projects are perfect.

Turn your Pi into a router proxy to block ads and other unwanted internet slime at the router level. In theory this would mean no more taboola links or ads on your devices without needing to install any kind of ad-blockers on the devices themselves.

Wireless Printer
If you’re anything like me you hoard old technology like it’s going to come back into fashion someday. I’ve gotten better lately, and thankfully I don’t have a shed full of old printers anymore, but if you did have an old non-wireless one, you could easily bring it kicking and screaming into the 2010s with this clever hack.

File Server
This makes an external harddrive accessible over the network, basically turning it into a fully functional NAS.

Audio Projects

There are a lot of audio projects out there, here are a few of my favourites

Audiobook Reader
I love minimalist controls, and you can’t get more minimalist than this single-button audiobook player. Press to play/pause, and hold down to skip to a previous track. Genius.

Turn an old amp into a wireless speaker
There are all kinds of airplay / google music / pandora radio rpi projects out there, but I like the style of this one.

Outdoor Projects

TimeLapse Dolly
RPi Timelapse camera setups are ten a penny, but this one has a dolly, so your timelapse shots will have that David Attenborough narrated BBC documentary feel to them.

Solar weather station


Touch screen car computer
Lots of folks out there are putting pi into their dashboards. I’d love to do this. I could fit my entire music collection on a single 128GB micro SD card, but my current car stereo can’t handle anything bigger than 8GB. I want to build one of these:

Extra Credit Projects

For the over-achievers of the world, here are some not so easy, but totally amazing projects.

CNC Wood Burner

Freely-arranged screens

Smart Mirror

Despite all these amazing links I’m full sure I’ll still be staring at an unused raspberry pi in a months time!

Vivaldi, and browser options

I installed Vivaldi the other day to give it a whirl. I was a little sceptical of their claims that it was a browser “for developers”

Then I went into the options. My jaw literally dropped. Literally.


Look at all those options!

Vivaldi has options that other browsers don’t provide by default. You can change the theme at a specific time of day, set up mouse gestures, move tabs to the sides or bottom, set a time-limit on your browsing history, change your default fonts (as in, when a web page says “sans serif” you get to pick what that means)

Firefox, Chrome, and Opera (my favourite, up to now at least) have plugins to cater for all of these things, but vivaldi does them out of the box. I thought that would make the whole thing feel bloated, but it’s buttery smooth. It seems to load pages faster than any other browser, though I suspect that’s down to the progress bar, which shows how many bytes have loaded (mesmerising).

I’m going to set Vivaldi as my default from today on, with Opera to fall back on if needed

wordcount is in the store

I’ve released a new app on the windows store, a universal / UWP app for counting words. It sounds silly, but I needed a way to count words on my phone, and there were no options.

At time of writing there are three other wordcount apps on the windows store. One is full of horrific full page ads, one doesn’t work (on wp10 at least), and one is a paid app.

It seemed to me that there was a gap in the market there for something that worked, didn’t cost anything and didn’t try to sell you some random crap. It takes some balls to charge someone for an app that counts words. As for the ads guy, don’t get me started.

Here’s a link to wordcount in the store, which is free, has no ads, no in-app purchases, and works on windows 10 and windows phone 10.

wordcount for windows 10


Found this nice little in-browser editor through HN:


– Your thoughts are backed up directly to Chrome: no account or syncing.
– Here are some handy shortcuts for you. Take notes ⌘B, ⌘I, ⌘U, ⇧⌘S
– Choose Day 🌤 or Night 🌕 mode
– Count the number of characters 🔢
– You can print your note

It has most of the things that Poe currently does, and a few that it will have in the next version. It doesn’t save your work, so you must export it to keep anything you write. This is a fairly big hole in functionality, something that could be easily fixed by leveraging localStorage.

It’s pretty though, and I like how simple it is. Simple is good.

wordpress from the command line

Decided to see if I could find a way to post to wordpress from the command line today. Promptly found wp-cli, which seemed to be the business. Promptly spent an hour trying to get it to install on Windows 10. I had to install php & composer first, only to find that method did not work. Then I had to download a .phar file and write a batch to install it. I also had to go fiddling with system path variables.

Would it be quicker if I knew what I was doing? Sure.
Would it take less than 2 minutes if I used Linux/OSX? Probably.

But neither of those conditions held true. I’m not au-fait with composer (though I should be I’m sure) and I don’t run Linux because I develop I use Visual Studio for work. More than that, all the many times I’ve tried various flavours of Linux over the years, they just haven’t floated my boat. They always feel unfinished.

Maybe soon I’ll try again, and maybe I’ll like it, but that’s for another post.

So I finally got wp-cli installed, and wasted about another 30 minutes trying to connect to wordpress. It seems that it wants me to install WP to a root folder, and then it can do command line stuff to that install. So basically, I have to run it on the server on which I have WP installed.

And I’m out.

Aside from taking hours to get up and running, and finding it doesn’t do what I want, the complexity is crazy, for a simple command line tool. The wp-cli folder installed has a brain numbing 2,635 files, and clocks in at 10mb. WordPress itself isn’t that complex, with just over 1,500 files and taking 50mb of my SSD. How can the simple command line tool to post to wordpress need 1,000 more files than wordpress itself? Granted this is a cloned git project, so a lot of that is probably not strictly necessary to the compiled app, but still it boggles the mind.

I abandoned wp-cli, and found a node.js library called “wordpress” which is ‘only’ 500 files (though these are hidden away in my node_modules folder). I can write a single node script that will do most of what I need to my remote wordpress install. If I’d only done this to begin with, those 90+ minutes would have been better spent.


Instantly play any song on the web, without even knowing its name!

Source: anysong.io

This little app is pretty neat. Finds songs by name or by lyrics, plays them in the browser. It sources them from youtube. Only ever had an issue with one so far – The Rolling Stones – Sympathy for the Devil, which was set not to be embeddable.

Try it!

UPDATE on Monday, February 1, 2016:

Anysong.io seems to have been taken down, presumably it angered the gods of music law. However, the source is still available on github if anyone is interested.


Edge can’t do bookmarklets…

I wanted to use the “PressThis” button to post about something else quickly today (filesprout – awesome, check it out) but instead I ended up falling down a rabbit hole of trying to set up bookmarklets in Microsoft’s new Edge browser. There are lots of search results on this, but all ultimately point to the same itworld.com article  on how to hack this together. Unfortunately, it doesn’t work for me. When I alter the content of a URL link in favourites it just disappears from the browser.

I wanted to give Edge a real try, but this issue is a deal breaker for me. I use bookmarklets daily and I don’t want to have to change that.

Must have tools for developers and power users

Every Windows developer should give this list a once over when setting up a new PC:

Scott Hanselman’s 2014 Ultimate Developer and Power Users Tool List for Windows

There aren’t many I can add to that list – Scott has pretty much covered everything.

Here are a few things I would also suggest:

  1. FFMPEG – if you do any work with video at all, FFMPEG converts things by command-line so you don’t have to install some dodgy app just to turn a mov file in an mp4 or whatever. It is complex to learn, but its easy to find and adapt command examples on superuser or the web in general
  2. SQLiteAdmin – strangely absent from Scott’s list are any SQLite tools. SQLite admin lets you poke around in SQLite databases and perform queries.
  3. SQLYog Community Edition – SQL Management Studio for MySQL

I don’t even install these, I just keep them in a dropbox folder synced between all PC’s.