32-Bits Can Go a Long Way
If you’ve made it to this blog post, you likely know Discord as a desktop application where you talk, play, and hang out while gaming, but did you know that Discord was first launched in 2015 as only a web app?
Starting as a web app allowed us to offer people a way to chat with their friends from the portability of their browsers, but to deliver the experience we wanted to offer, we needed to leap out of the browser and take to the desktop. By using a web wrapper called Electron, we can run Discord in a browser-like environment but with access to all the extra little bits that allow us to offer features such as our In-Game Overlay. When we built that first executable on Windows, we had to decide whether to target 32-bit or 64-bit processors. With 32-bit, you can write once and it will work pretty much everywhere thanks to Microsoft’s backwards compatibility layers. That makes sense for a first version of an application — it will work on both 32-bit and 64-bit machines while only needing one version of the app.
Performance-wise, 32-bit uses less memory than 64-bit, but sometimes to a fault: 32-bit applications have a hard restriction on memory usage, which using 64-bit architecture is meant to solve in the first place. Though running as a 32-bit application on a 64-bit machine gives us extra memory for Discord, we occasionally still hit the limit, causing errors or even crashes.
Discord is built using an assortment of many libraries, such as Electron and WebRTC, which together help us deliver the ideal desktop Discord experience to you. These tools have supported 64-bit builds for years now, and, in fact, default to 64-bit architecture. As 64-bit becomes standard across more and more machines, we expect that it will receive significantly more refinement and bug fixes than 32-bit. If Discord were to stay on 32-bit for the foreseeable future, we may potentially expose ourselves — and in turn, our users — to new bugs and inefficiencies that aren’t addressed simply because there aren’t enough people maintaining 32-bit libraries to find them.