06 / UNDER THE HOOD
Tauri Wasn't Much Lighter Than Electron
Wawa turns WhatsApp conversations into tasks. The desktop app runs the whole workspace on your own computer: the interface, a local app service, a WhatsApp gateway, and optionally Codex. The code is on GitHub.
The first desktop build was Electron, and it only built for macOS. I moved it to Tauri. Tauri is usually pitched as the lighter option, so I measured it. The result was less exciting than that pitch.
What the app actually runs
The window is the smallest part of Wawa. Behind it are separate processes:
- the app service, which serves the interface and the API on localhost
- the WhatsApp gateway (OpenWA), which by default drives a real browser in the background
- a supervisor that starts those, checks their health endpoints, and stops them on quit
In Electron, the supervisor is Electron’s own main process. It spawns the service and the gateway with Node and keeps an eye on them. No extra process.
Tauri’s main process is Rust. I didn’t want to rewrite the supervisor in Rust, so the Rust side spawns a JavaScript runtime with a small tauri-runtime.cjs script, talks to it over stdin and stdout, and that script spawns everything else. That’s one more process Electron didn’t need.
What I measured
Both shells showed the same Overview screen with the same fictional tasks on one Mac. I took five interleaved samples of macOS physical footprint for each and used the median.
| What was counted | Electron | Tauri (Node sidecar) | Tauri (Bun sidecar) |
|---|---|---|---|
| Window and its helpers | 132 MB | 121 MB | not measured separately |
| Window, helpers, local service and supervisor | 187 MB | 205 MB (range 205-227) | 178 MB (range 178-181) |
The window on its own was a bit smaller in Tauri: 121 MB against 132 MB. Tauri uses the system WebKit, but WebKit still runs its own helper processes, and they count.
Once the local service and the supervisor were included, Tauri was heavier: 205 MB against 187 MB. The Node supervisor alone was about 24 MB in one sample. That one extra process more than ate the saving from the window.
The caveats matter here, so here they all are:
- The Mac was busy. These are point-in-time samples, not a benchmark.
- The Electron side was a minimal shell around the same interface, not the full shipping Electron app.
- Neither run included the WhatsApp gateway or a running Codex process.
- The Bun column was a separate run at a different time from the other two.
So the honest summary is: for this app, swapping Electron for Tauri was not a big memory win. The window got a bit smaller, and the architecture I chose added a process back.
Moving the sidecar to Bun
The Tauri build used to ship a separate Node binary for the supervisor, the app service, the gateway and the workspace transfer. I switched all of them to one bundled Bun binary. The prepare script copies the Bun running the build into the bundle, and the Rust side starts that instead of Node.
After the switch, the same fictional Overview measured a median of 178 MB across five samples, with a range of 178 to 181 MB. That includes the supervisor, the service and the WebKit helpers. It’s below both earlier numbers, but it came from a different run on a different day, so I treat it as “probably better”, not as a precise saving.
Getting the preview running everywhere wasn’t free. A few things broke around the same time, and most of them only showed up on Windows:
- A console window. On Windows, starting Bun from the Rust side flashed a terminal. Spawning it with the
CREATE_NO_WINDOWflag fixed that. - Paths inside the transfer archive. Workspace transfers were writing media paths with the platform’s separator. On Windows that meant backslashes inside the archive. They use
posix.joinnow. - Gateway loading across drives. The gateway’s TypeORM entity loader resolved globs relative to the current directory. With the app on one drive and the data directory on another, it couldn’t find its own files. The staging script patches that one call on Windows, and fails loudly if the upstream code changes.
- A version floor. The prepare step refuses to run on Bun older than 1.4.4, because workspace transfers weren’t reliable before that. CI pins the version.
Before anything gets packaged, CI on Windows adds a firewall rule that blocks outbound traffic for the staged bun.exe, then runs the runtime check against it. The check uses fictional data, starts an unlinked gateway, and tests encrypted export and import, including that the old workspace is kept as a backup. On Windows it runs with the app and the test workspace on different drives. On macOS the same check runs under sandbox-exec, which denies outbound network access except localhost.
Why I kept Tauri anyway
Memory wasn’t what decided it. What I got from the move:
- More platforms. The Electron build only had a macOS packaging script. The Tauri preview now builds for Apple Silicon and Intel Macs, Windows x64 as an NSIS installer, and Linux x64 as a Debian package, all in GitHub Actions. Linux ARM64 is out for now because the pinned WhatsApp browser has no build for it.
- A separate identity. The Tauri preview had its own app identifier and data directory from day one. It never opened the Electron workspace or reused its WhatsApp session. You move between them with an explicit encrypted transfer, so I could test it without risking the working app.
- Fewer dependencies. Dropping
electronandelectron-builderremoved the Electron packaging config and their dependencies.
The real weight is WhatsApp
The interface isn’t where the memory goes. The default gateway drives a browser. An earlier snapshot put about 1,360 MB on the current app’s separate WhatsApp browser, but that was a connected account with real history, so it isn’t comparable to anything above. The Tauri preview still contains that browser and its runtime.
OpenWA also has a browser-free engine built on Baileys, which talks to WhatsApp directly. I tested it without a WhatsApp account and with outbound network blocked:
- The gateway started in a temporary directory, reported
baileysas its engine, and had zero sessions. - OpenWA’s offline inbound-message suite passed all 13 cases, including text, images, edits and reactions. It uses the real Baileys parser, but doesn’t download media or contact WhatsApp.
- The unlinked gateway used 267 MB of physical footprint across five samples.
- Preloaded with a script that parses 1,000 fictional text messages through the real Baileys parser, it used 310 MB across five samples. Nothing was persisted and no media was downloaded.
Those are offline, unlinked numbers. They don’t tell me what a connected account with a real message history will use, so I don’t know the real saving yet. OpenWA also documents a higher account restriction risk for the browser-free engine. In Wawa it’s an option called Lightweight, marked experimental. Standard, the browser engine, stays the default. Switching engines means linking WhatsApp again.
What I took from it
Measure the whole app, not the window. The shell was the smallest thing in Wawa. The supervisor cost more than the window saved, and the WhatsApp browser dwarfs both.
If I want a lighter Wawa, the next number to get is a connected Baileys account next to a connected browser account, on the same test number with the same history. Until then, Tauri is the shell that builds everywhere, and Bun is the runtime that made it a little smaller.