From 4 GB to 117 MB: Rust on the desktop
Native pays off for an all-day app: our Rust window used 117 MB in one process, against about 4 GB for the web view. Prove the hard parts first.
Native pays off for an all-day app: our Rust window used 117 MB in one process, against about 4 GB for the web view. Prove the hard parts first.
Record each turn as a run, lease every attempt with a fenced heartbeat, keep agent state in Electric's durable streams, and never replay a tool call to recover.
Coding agents optimise for finishing the task, not your scope, so drift builds up. Write scope as a contract, turn criteria into tests and verify continuously.
A recurring report. A slow review. A prototype that needs to work in the real world.
A native desktop client drawn straight on the GPU (no embedded browser engine, no HTML or CSS in the middle) is worth building when people keep the app open all day, when memory and idle CPU matter, and when you already have a public API and design system to generate from. Our prototype of the Company Twin's desktop window, written in Rust on the Rune framework, sat at 117 MB in a single process at rest; the web-view client it's replacing used about 4 GB across 15 processes. That isn't like-for-like yet (the prototype has no mail or calendar, which the web-view client includes), and it's still pre-release software: reading the Twin works against our staging organisation, writing has started, and mail and calendar are still to come. Because Rune was weeks old when we picked it up, we proved the hardest parts first and locked it out of every crate that holds state.
Key takeaways
Our first desktop client, Twin Desk, is a sensible design. It wraps the Twin's web app in WebKit tabs and builds mail and calendar natively alongside it, so every web feature lands on the desktop for free. On a working Mac, though, its window used around 4 GB of memory across the app and 14 helper processes. Each web view drags in its own content, networking and GPU processes, and an app people leave open from nine to six pays that tax all day.
It's the classic trade-off. A web view hands you every feature the web app has; a native client gives you control over memory, start-up, idle cost and offline behaviour, at the price of rebuilding what you draw. We wouldn't make that trade for a tool people open once a week. We made it for the client our own team lives in all day, where mail, calendar and the Twin meet.
A prototype of the same window drawn by Rune, a GPU-rendered Rust UI framework, used 117 MB in one process and 0% CPU when idle. Rune is open source and very young, created in late October 2026, with no web view, HTML or CSS, and maintainers who take issues rather than pull requests. That combination of a big gain and a pre-release dependency shaped every engineering choice that followed.
You don't bet a client on a pre-release framework by reading its README. You write throwaway proofs for the five things a Twin client can't live without (the exact areas a young framework is most likely to stumble on) and measure them. Frame times below are CPU time per frame at 120 frames a second on an optimised build, run headless on Apple silicon; they exclude uploading to the GPU and presenting.
| Proof | What it covered | Result |
|---|---|---|
| Text input | A composer with @-mentions, mail compose, a record form, input methods, undo and accessibility | 8 headless checks pass. Typing Japanese or Chinese into a real window still needs a person at a keyboard |
| Streaming | A live agent session with reconnect and resume | All six scenarios of the session fixtures; resumes over a real socket; p95 0.32 ms per frame |
| Large channels | 10,000 records in table, board, list, calendar, timeline and matrix views, with 40 changes a second | Table p95 3.4 ms, board 2.4 ms, list 3.2 ms |
| Design system | All 21 themes and the web app's icon set | 546 sampled pixels within 0.9/255 of the browser's colours; 230 of 233 icons match a reference renderer |
| HTML mail | Rendering email without a web view and without fetching anything | On 25 made-up messages, 22 drew as intended, 2 simplified and 1 needed "open original". Real mail not yet measured |
Each proof used fixtures or made-up data; real-data results come from the milestones that followed.
The proofs earned their keep by finding bugs early. Two Rune drawing defects came straight out of the icon check: a round-capped line of almost zero length (how the Lucide icon set draws a dot) got dropped, and a round join went missing where a path turns back on itself. Until Rune fixes them, our icon generator emits those marks in a form Rune draws cleanly, and we've drafted reports for the maintainers. That's what you want to uncover before committing, not three months in.
The client lives in its own Cargo workspace with a pinned toolchain. Rune is pinned to one git revision and bumped deliberately, checked against golden renders of every screen. Every third-party crate is pinned to an exact version, unsafe code is denied, and so are unwrap, todo! and debug macros.
Only app (the composition root) and ui (the screens and controls) are allowed to depend on Rune. The tokens crate, holding generated themes, measures, motion and icons, can use its types only. Everything else stays plain Rust: the Twin's state (the feed follower, projections, actions, optimistic changes and undo), the SQLite stores, the mail and calendar adapters, the updater, the platform layer and the gateway client. A test over cargo metadata fails if any of those picks up a Rune dependency, or if any crate other than platform picks up a platform-only one.
Three other boundaries keep the client honest.
The second milestone ran the app against our staging organisation through the public gateway on 11 November 2026. Sign-in goes through the default browser; the ID token's signature is verified and the session lives in the system keychain and nowhere else. A cold launch made 91 gateway reads, all of which succeeded. A relaunch made 5; everything else rendered from the local store and caught up from the saved feed cursor. Switching organisation gives each one its own store, and a session started from the home screen streamed live as the agent replied.
| Measure | Result | Budget |
|---|---|---|
| Kept Twin ready after launch | 46 ms (48 to 75 ms in the earlier debug-build run) | Content on screen under 300 ms |
| Tour of a table, a board, the inbox and the sessions list | p95 2.1 ms per frame, mean 0.8 ms | p95 under 4 ms |
| An answer streaming into a session | p95 2.5 ms per frame, mean 1.1 ms | p95 under 4 ms |
| A real window at rest (debug build) | 0.0% CPU, 132 MB | 0% CPU; under 250 MB with three mail accounts |
Not yet measured: a 10,000-record channel on real data, memory with mail accounts connected, and the delay before a change made in the web app appears here.
Since then the app has rendered a channel's table, list and board views from real records, marked an inbox item done and put it back with undo, sent a follow-up in a session and stopped a running turn. Self-updating works between two signed builds on one Mac, though it isn't notarised or published yet.
Mac comes first, but we wrote the codebase so Windows won't mean a rewrite. Platform code sits behind nine interfaces in the platform crate (secrets, code-signature checks, updates and packaging, data folders, launch at login, opening links, notifications, single instance and menus). No other crate is allowed to contain cfg(target_os), enforced by a source test. A missing Windows implementation fails loudly with a named error rather than falling back silently. Shortcuts are defined once on the primary modifier, every command lives in one action registry shared by the menu bar and command palette, and every change compiles for a Windows target in our pre-release checks for the crates that don't need a C compiler. Nothing has shipped to Windows yet.
If people only open an app occasionally, a web view's memory footprint is a fair trade for getting every feature for free. If most of what you display is HTML you don't control (rich documents or interactive canvases), a native client ends up handing those to a browser anyway, just as ours does for canvases and admin pages. And without a stable public API, a native client gets tangled in private routes that shift underneath it. Our build only made sense because the gateway, the design system and the event feed already existed as contracts to generate from and test against. We set out how each client reaches the Twin in one Twin, many interfaces.
If you're weighing Electron, a system web view or native for an internal tool, start by measuring the client you already have in real daily use: memory and process count at rest, start-up time, and idle CPU across a working day. Then list the hardest parts of the UI and prove those in throwaway code before picking anything. The boundaries matter more than the framework: keep state, sync and integrations clean of the UI layer, generate the API client and design tokens from their sources, and enforce the walls with tests. Our note on the last mile for coding agents covers how we keep builds like this from drifting.
Adopting a young UI framework safely
Native desktop, web app and CLI all sit on the same public gateway: one set of records, definitions and permissions underneath whichever interface your team prefers. See the Twin and its public gateway →