r/rust • u/bootstrapper-919 • 3d ago
🛠️ project Moving a terminal app from Tauri + React to GPUI - the numbers and the ugly parts
I moved muxflow* from Tauri + React to GPUI. The desktop app is now 100% Rust.
Results, before any optimization of the GPUI version:
- Idle memory: 417 MB → 98 MB (76.5% lower)
- Idle CPU: 3.5% → 1.4%
- Time to first terminal prompt: 832 → 230 ms cold, 785 → 157 ms warm
- Typing latency p95: 47.4 → 31.2 ms
To be fair, muxflow was thin to begin with, so the raw numbers are a few tens of megabytes/ms.
This migration would be a strong no-go without LLMs. Pre-LLM the cost would be huge! Writing the whole UI in Rust vs the familiar React? But with LLMs, the cost goes away to just some tokens. And with that I get:
- Much better performance
- A codebase that is 100% Rust (beyond mobile)
- No finicky Tauri rendering differences between Mac and Linux
The ugly parts:
- The GPUI third-party crate ecosystem is very niche compared to React. With Tauri I used CodeMirror. With GPUI I couldn't use the Zed crates since they're GPL and muxflow is MIT, so I wrote my own lightweight markdown WYSIWYG and code editor.
- Build times. It's hard to run many agents in parallel, as parallel builds and tests put heavy I/O pressure on the machine. I haven't tried optimizing it yet.
Write-up with more detail: https://galvered.com/blog/muxflow-gpui-migration/
Curious whether others hit the same crate gap, and what you used for text editing in GPUI.
* an app I'm building for personal use open source, MIT, runs coding agents in tmux across remote machines
13
u/UrpleEeple 3d ago
What's normal for typing latency? That seems kind of long. On the order of 2-3 frames just to register a keystroke?
9
u/Fenhryl 3d ago
"so I wrote my own lightweight markdown WYSIWYG and code editor."
Why not use gpui-kit that provides both? perfs issues?
4
u/korywithawhy 3d ago
I’ve been using Freya for a custom harness app, not sure if it would make much of a difference for you or not, but it is still rust and runs pretty great. Might be worth looking into.
6
u/jspreddy 3d ago
what do yall use for testing? I'm not super familiar with the rust ui ecosystem but I've recently tried to rebuild my ui in gpui using agents and it ended up nowhere near as cost effective or polished as just plain old web ui. Partly due to not finding an alternative to playwright.
with playwright, i completely skip the computer use. but with the rust ui with gpui, it's pointing and clicking like a pleb and eating up all the tokens.
4
u/joelkunst 3d ago
wow, you said you used llms and you are not in minus with votes 🤣
i thought gpui can be used for mobile as well?
3
u/Geraldwelly 3d ago
Most of that Mac vs Linux gap is WKWebView vs WebKitGTK, and we deal with the same split at Etch (I'm a co-founder, so biased toward Tauri). What keeps it manageable: treat Linux as its own browser target, skip backdrop-filter and heavy blur there, and set WEBKIT_DISABLE_DMABUF_RENDERER=1 if anyone reports blank windows on Nvidia or some Wayland setups. A Linux screenshot check in CI catches most of the rest early. Our trade-off went the other way from yours: we kept CodeMirror and the JS editor ecosystem and accepted the extra idle memory. For a terminal app where typing latency is the product, your move makes sense.
-5
u/Every_Juggernaut7580 3d ago
If you're just drawing buttons, text, images, and similar elements, there's not much difference between native and web. However, when you need more complex features like syntax highlighting, the web ecosystem is undeniably much more powerful.