liveBook · Manning

Electron

As explained in Fast by Default

Electron is a framework for building cross-platform desktop applications with web technologies and a bundled Chromium and Node.js runtime.

Electron packages a web application as desktop software by bundling Chromium and Node.js. Interfaces use HTML, CSS, and JavaScript, while Node.js APIs provide native-system access. This lets web-focused teams build cross-platform desktop applications without moving their UI work into C++. section 5.2.3

The bundled runtime is also Electron's central cost. An application includes a complete browser engine, adding more than 100MB to its size and typically using 200–300MB of idle memory. That overhead can mean battery drain or system slowdown when several always-open desktop applications compete for resources. section 5.2.3 section 8.4

Treat Electron performance as work across startup, rendering, memory, and distribution rather than as a final cleanup task:

  • Reduce shipped JavaScript and unnecessary work; VS Code cut shipped JavaScript by 20% with targeted name mangling, alongside optimization of startup, rendering, and memory paths. section 5.2.3
  • Virtualize long lists and debounce expensive operations so interface work does not grow directly with visible data or repeated input. section 5.2.3
  • Profile the browser process for the specific window that drops frames, because each Electron window runs in its own browser process. section 7.4.3
  • Separate the framework from application code and assets when analyzing installer growth, then make artifact size a release concern. section 8.4

Memory diagnosis must cover both sides of the application boundary. Removed page elements remain live when JavaScript still references them, and backend message handlers can retain processed data. Event listeners added in the Node.js backend but never removed create steady memory growth. Browser developer-tool memory snapshots with the Detached filter identify browser-side leaks; Node.js snapshots through --inspect cover the backend. section 7.4.1

Installer growth as an operational problem

A Windows Electron project-management installer reached 420MB. Enterprise customers reported deployments taking hours across internal networks, and the size issue surfaced in business reviews and renewal discussions. The investigation began by distinguishing Electron's framework footprint from the application's code and assets. section 8.4

How Fast by Default covers it

How deep it goes
Explains runtime costs and gives concrete optimization and profiling practices for startup, memory, rendering, and artifact size.
Examples
Uses VS Code optimization and a 420MB Windows project-management installer deployment incident.
What you can do after
Apply it via Electron to package web applications while profiling memory, window rendering, and shipped artifact costs.
How it connects
Connects Chromium, Node.js, Chrome DevTools, memory snapshots, rendering processes, and build artifact analysis.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Fast by Default. The section links point to the parts of the book it draws on.