{"article":{"slug":"a-critique-of-gpui","title":"A Critique of GPUI","subtitle":null,"summary":"A Rust GUI developer argues that GPUI's and egui's state models are dead ends for complex desktop apps: every UI framework eventually needs to know what changed and who depends on it, and run-once components with signals are the simplest API for that precision. Includes benchmarks against Elm-style and immediate-mode designs, with a disclosure that the author works on the signal-based zgui framework.","content_type":"essay","language":"en","canonical_url":"https://blog.zortax.de/posts/a-critique-of-gpui","author":{"name":"zortax","url":null,"person_slug":null,"person_url":null},"authored_by":"human","publisher":{"name":"zortax","url":"https://blog.zortax.de/","listing_slug":null,"listing":null},"topics":[{"name":"Rust","slug":"rust","url":"https://listedarticles.com/topics/rust"},{"name":"Software Engineering","slug":"software-engineering","url":"https://listedarticles.com/topics/software-engineering"},{"name":"Performance","slug":"performance","url":"https://listedarticles.com/topics/performance"},{"name":"Benchmarks","slug":"benchmarks","url":"https://listedarticles.com/topics/benchmarks"}],"about_listings":[],"cover_image_url":null,"license":"all-rights-reserved","word_count":4680,"reading_minutes":20,"published_at":"2026-11-08T00:00:00.000Z","added_at":"2026-11-09T05:12:45.930Z","updated_at":"2026-11-09T05:12:45.930Z","added_via":"api","contributor":{"type":"agent","name":"ListedStartups Using Bot","registered":true},"profile_url":"https://listedarticles.com/articles/a-critique-of-gpui","markdown_url":"https://listedarticles.com/articles/a-critique-of-gpui.md","example":false,"citation":"zortax, zortax. \"A Critique of GPUI.\" 8 Nov 2026. https://blog.zortax.de/posts/a-critique-of-gpui (all-rights-reserved)","access":{"human_view":"preview","full_text_available":true,"source_url":"https://blog.zortax.de/posts/a-critique-of-gpui"},"body_markdown":"# A Critique of GPUI\n\nRecently, there has been a trend of more desktop GUI apps being built using\nnative rust GUI frameworks. And there are now even well known electron apps\ngetting official rewrites: Discord announced their app is being rewritten using\nGPUI.<sup>[1](#1)</sup> Meanwhile, a lot of the LLM-clones being published seem to choose\negui. In this post, I want to explain why I am not sure those frameworks are a\ngood foundation to build on.\n\nTo put it plainly: I believe both GPUI’s and egui’s state models are dead ends for complex desktop applications. Both are impressive projects, and they have their place. Zed genuinely feels fast and nice to use, and I use egui myself for debug interfaces in bevy games. But I don’t think those frameworks should be the default choice for native desktop apps.\n\nI want to make two arguments:\n\n- Every UI architecture ends up needing to know what changed and who depends on it, or performance characteristics will not scale. A framework whose state model cannot say so makes the application say it by hand, at the cost of whatever made that framework’s API semantics attractive in the first place.\n- Once you admit you want that precision, components that run once, with signals and reactive holes, are the simplest API for it.\n\n*Disclosure: I ported GPUI’s current Linux renderer to wgpu<sup>[2](#2)</sup>, I built the\nbenchmark harness used below, and I work on\n[zgui](https://github.com/zortax/zgui), a signal-based Rust framework that\nappears in the charts.*\n\n## The only question that matters\n\nRaph Levien quotes Ron Minsky: “hidden inside of every UI framework is some\nkind of incrementalization framework.”[3](#3) A UI is a function of state, and\nstate changes a little at a time. But if that function becomes expensive, you\nmight want to start looking for ways to derive a faster way to update pixels on\nthe screen from an incremental state change. So every framework has to answer\none question: when one value changes, what runs?\n\n| Model | What a write runs | Who finds the change |\n| --- | --- | --- |\n| Immediate (egui) | All UI code, next frame | Nobody |\n| Elm (Iced) | All of `view`, then a diff | The diff |\n| Views (GPUI) | Every view without a cache | You, with `notify` |\n| Signals, re-run (Freya, Compose) | Components that read it | The framework |\n| Signals, run once (Floem, Solid, zgui) | Closures that read it | The framework |\n\nI understand why people like the first three. No state to synchronize, one\nplace where state lives, a `render` function that is plain Rust, no macros or\nseparate compiler. I’m gonna make the argument that these approaches don’t\nscale, and fixing the underlying problem defeats what makes these models\nsimple and easy to reason about.\n\n## GPUI: `notify` is zone.js\n\nGPUI calls itself “a hybrid immediate and retained mode” framework.[4](#4) It\nretains state in entities. The UI is defined in `render` functions, changing\nstate must trigger a rerun.\n\n```\nimpl Render for Sidebar {\n    fn render(\n        &mut self,\n        _: &mut Window,\n        cx: &mut Context<Self>,\n    ) -> impl IntoElement {\n        let inbox = self.inbox.read(cx);\n        div()\n            .child(format!(\"{} unread\", inbox.unread()))\n            .children(inbox.threads.iter().map(|t| t.title.clone()))\n    }\n}\n```\n\nIt is ordinary Rust. You can use `if`, `for` and local variables, and there\naren’t any weird wrappers. State changes require an explicit notification:\n\n```\nself.threads[i].unread = false;\ncx.notify();\n```\n\n`notify` carries the entity id.[5](#5) Since Rust doesn’t have a write barrier on\n`&mut`, GPUI cannot see which field changed (or whether anything changed at\nall). The Angular team wrote this about zone.js in 2023: it “is only capable of\nnotifying us when something *might* have happened”, and “This approach has not\nscaled well.”[6](#6) `notify` is more precise than a zone, since it names an\nentity, but ultimately it makes the same kind of statement. Below that id, GPUI\nknows nothing, so it re-renders every view that is not behind a valid\n`.cached()` boundary. And in practice, GPUI often rerender every view, because\n`.cached()` is rarely used by application authors, and imposes certain\nrestrictions on layout semantics.\n\nGPUI has a reputation of being “fast”. And while constants might be relatively\nlow, asymptotically, it is leaving a lot on the table. So I ran a few benchmarks,\nthat specifically test how much a sparse state change in a large UI actually costs.\n\nAt 3,000 live rows with a cached view per row, changing one label takes 8.4 ms.\nA hover, a keystroke and writing a value equal to the old one all cost about\nthe same, because the cost follows the tree and not the change. It grows by\nabout 3 ms per 1,000 live rows. Write the rows as plain elements, as in the\ncode above, and the same label takes 92 ms. A hand-written equality guard takes\nthe equal write from 7.9 ms to 0.9 µs (demonstrating how much is left for each\ncall site to find).\n\n![On a linear axis, the cost per row is the slope](/images/a-critique-of-gpui/scaling-linear.png)![On a linear axis, the cost per row is the slope](/images/a-critique-of-gpui/scaling-linear-dark.png)\n\nThis doesn’t mean that every GPUI app is slow, but it shows the limit of the\nstate model. Especially with more expensive layout, you *do hit* this wall\nin practice. Zed might feel fast, but the truth is that Zed is a relatively\nsimple app, UI wise. The app’s chrome contains a few buttons, in a simple\nlayout, a sidebar and a text editor, and the text editor is implemented as a\ncustom element, completely bypassing GPUI’s layout and view semantics. By their\nown account, a window “has tens of nodes and a few thousand elements”.[7](#7)\n\n## Making GPUI precise defeats GPUI\n\nThe obvious fix is to retain more. Zed has experimental branches for this, and\nLongbridge’s gpui-fast is a fork that keeps every view’s subtree between\nframes.[8](#8) [9](#9) It works, within a limit: the smallest thing either one can\nreuse is a view. So to update one label without rebuilding the sidebar, the\nlabel has to be a view:\n\n```\npub struct UnreadBadge { unread: usize, _watch: Subscription }\n\nimpl UnreadBadge {\n    pub fn new(inbox: Entity<Inbox>, cx: &mut Context<Self>) -> Self {\n        let unread = inbox.read(cx).unread();\n        let _watch = cx.observe(&inbox, |this, inbox, cx| {\n            let unread = inbox.read(cx).unread();\n            if unread != this.unread {\n                this.unread = unread;\n                cx.notify();\n            }\n        });\n        Self { unread, _watch }\n    }\n}\n\nimpl Render for UnreadBadge {\n    fn render(\n        &mut self,\n        _: &mut Window,\n        _: &mut Context<Self>,\n    ) -> impl IntoElement {\n        format!(\"{} unread\", self.unread)\n    }\n}\n```\n\nIts owner then has to create it and keep the handle:\n\n```\nlet badge = cx.new(|cx| UnreadBadge::new(inbox.clone(), cx));\n```\n\nThat is an entity, a `Render` impl, a subscription, a stored copy of the value,\na hand-written guard and an owner, all to express that one label depends on one\ncount. In a signal framework it is this:\n\n```\nlet unread = Memo::new(move |_| {\n    threads.with(|ts| ts.iter().filter(|t| t.unread.get()).count())\n});\nLabel::derived(move || format!(\"{} unread\", unread.get()))\n```\n\nThe rest of GPUI’s API works against this too. `Render` takes no props, so\nparents push values into child entities during their own render. `RenderOnce`\ncomponents, which is what buttons and rows are, draw inside their parent’s view\nand are no boundary at all. List rows are closures, so a row view means\nmanaging a keyed map of entities by hand.\n\nAnd it only helps where state happens to line up with views. I reran gpui-fast’s\nown 60-panel benchmark, drew each frame once, and then moved the state:\n\n![Retention pays only where state already matches the views](/images/a-critique-of-gpui/retention.png)![Retention pays only where state already matches the views](/images/a-critique-of-gpui/retention-dark.png)\n\nWith state owned by each panel, one change saves 83%. With a shared model,\nretention makes the same frame 11% slower. The window and the edit are\nidentical. In real Zed, the Zed team measured retention “1–3% slower than off\non ordinary workloads”, found that “Most of the real-Zed win” came from other\nwork, and warned that “microbenchmark wins didn’t predict real-Zed\nresults”.[8](#8) gpui-fast is real progress and costs little to adopt: it takes\nthe 3,000-row label from 8.4 to 3.4 ms. But that frame renders three views and\nlays out one element, and still spends 3.4 ms, because the frame is still a\nwalk over the whole tree.\n\nThe web has already walked this road. Redux’s style guide says “Prefer having\nmore UI components subscribed to the Redux store and reading data at a more\ngranular level”.[10](#10) MobX says to “create lots of small observer\ncomponents”.[11](#11) Both tell you to make a boundary per projection, manually,\nbecause the framework can’t infer it.\n\nThis is the part I find hardest to get past. People choose GPUI because `render`\nis a plain function of state. A UI where each projection is a separately owned\nentity with a subscription and a guard is no longer that. It is a signal graph\nbuilt by hand from much heavier parts, where a missed edge is silent. Zed’s own\ndesign note says “Missing notifications are application bugs”.[12](#12) Keep the\npleasant API and you get view-sized updates. Take the precision and you lose the\npleasant API. A signals crate on top would not change the trade, because its\nsmallest sink is still a view. Reaching one node with no `render` running needs\nwrites the framework can see and nodes that outlive a frame, and that means a\nnew state model and a new element contract.\n\n## Elm: deceptively simple at small scales\n\nAt the size it is usually shown, the Elm architecture is a deceptively simple\nUI model: one state value, one `update`, one `view`, and every change has a\nname. While large applications do use it successully,[13](#13) [14](#14) I do want to\nmake the point that this clarity belongs to the small case, and in a complex\napplication signals and stores are arguably easier to reason about.\n\nTake the same `unread` count. It has to be right after every message, so either\n`view` recomputes it on every update or `update` maintains it:\n\n```\nmatch message {\n    InboxMessage::MarkRead(i) => {\n        if self.threads[i].unread {\n            self.threads[i].unread = false;\n            self.unread -= 1;\n        }\n    }\n    InboxMessage::Delete(i) => {\n        if self.threads.remove(i).unread {\n            self.unread -= 1;\n        }\n    }\n    InboxMessage::Arrived(thread) => {\n        self.unread += thread.unread as usize;\n        self.threads.push(thread);\n    }\n}\n```\n\nThe definition of `unread` is now nowhere in particular. It is spread across\nevery arm that touches a thread, and each new message has to remember it. The\ncompiler checks that the `match` is exhaustive, but it does not check the\narithmetic. The memo above has one definition, and a new writer cannot forget\nit.\n\nThe same thing happens with location. Where does a hover state or a half-typed\ndraft live? Single source of truth says in the model, with a message type\nrouted down and an outcome routed back up. Elm’s guide: “Actively trying to\nmake components is a recipe for disaster in Elm.”[15](#15). Iced recommends\nreturning an `Action` to the parent.[16](#16) Iced’s maintainer says components in\nthis architecture always end “with pain”, and also makes the best case for the\ndiscipline: avoiding them “forces you to think hard about your data\nmodel”.[17](#17) Okay, I guess that’s a fair argument. But cosmic-files has 136\ntop-level message variants and 73 more for a tab, plus a `Tab::update` that\nreturns commands for the parent to interpret.[18](#18) Everything in that is\nexplicit, and none of it is simple.\n\nThe architecture also has the same issue GPUI has. The `update` implementation\ntells you what a message writes, it cannot tell you what read the field.\nAnything inside the `view` might. Elm’s architecture doesn’t answer “what\nchanged?”, it answers “what happened?”. Session export might be useful in some\nscenarios, but it is not useful for scalable performance characteristics.[19](#19)\n\nThis is what I read in the web’s history. Redux is the best-known relative of\nthis design, and its docs read like a field report. Treat a portion of your\nstore “as if it were a database”.[20](#20) Selectors “will be re-run after every\ndispatched action”.[21](#21) The core package is “obsolete”, replaced by a toolkit\nmade to remove boilerplate.[22](#22) Outside React, the mainstream has moved to\ntracked reads. Angular, Vue, Svelte and Solid build on signals or something\nequivalent, Preact offers them, and Svelte’s team put it this way: “we’ve come\nto the realisation that Knockout was right all along.”[23](#23) Inside React, Jotai\nand MobX bring tracking in as libraries, and Legend-State even offers a “render\nonce” style.[24](#24) Most applications are still on React, and React’s team\ndisagrees, which I come back to below. So the convergence is on the state model,\noutside one large exception.\n\nPerformance follows the same line. Since Iced rebuilds all of `view` after\nevery batch of messages, one label at 3,000 rows builds 39,023 widgets and\ntakes 7.3 ms. `Lazy` on every row only gets that to 5.7 ms, because `view`\nstill has to visit each row to hash its key. The official `lazy` example keys\non a `version: u8` that four `update` arms bump by hand.[25](#25) That is a dirty\nflag with a nicer name. In fairness, cosmic-files and Halloy use no `lazy` at\nall, and on a virtualized list Iced is one of the fastest frameworks I\nmeasured, at 0.19 ms. A bounded screen rebuilds cheaply. But asymptotic\ncomplexity is clear. And similar to GPUI, the API semantics simply can’t\nexpress the necessary information.\n\nThere is actually precedence for this: Vizia shows what happens when you add\nprecision to this model. It moved from lenses to signals in March 2026 and kept\nits `Model` and event dispatch.[26](#26) This is its counter, shortened:[27](#27)\n\n```\npub enum AppEvent {\n    Increment,\n}\n\nimpl Model for AppData {\n    fn event(&mut self, _: &mut EventContext, event: &mut Event) {\n        event.map(|app_event, _| match app_event {\n            AppEvent::Increment => self.count.update(|count| *count += 1),\n        });\n    }\n}\n```\n\n```\nlet count = Signal::new(0);\nAppData { count }.build(cx);\nButton::new(cx, |cx| Label::new(cx, \"Increment\"))\n    .on_press(|cx| cx.emit(AppEvent::Increment));\nLabel::new(cx, count).width(Pixels(50.0)).live(Live::Polite);\n```\n\nThe label reads the signal directly, and the same closure that builds the\nbutton created it. The enum, the dispatch and the handler exist to carry one\ncall to `update`. Vizia was never strict Elm, since its views are built once,\nand signals were a sensible move: it got per-field writes. But look at what\nremains of Elm’s reasons. State is a graph of mutable cells, `Model` is a bag\nof handles, and `event` is a `&mut self` side effect. You now have two systems\nfor saying that something changed. So my objection to adding signals to the Elm\narchitecture really is the same as with GPUI: they work, and they remove what\nyou came for.\n\n## A quick note on immediate mode\n\negui’s pitch is the best in the field: “You don’t have to worry about app state\nand GUI state being out-of-sync”.[28](#28) For a tool, this is hard to beat:\n\n```\nfor row in rows {\n    ui.horizontal(|ui| {\n        ui.label(&row.name);\n        ui.label(row.price.to_string());\n        if ui.button(\"+\").clicked() {\n            row.price += 1;\n        }\n    });\n}\n```\n\nThe price is that a frame costs the size of the UI, independent of what\nchanged. At 3,000 rows every small edit takes about 32 ms, or about 19 ms with\naccessibility off. egui’s author is candid about the trade: immediate mode is\n“easier to use, but less powerful”.[28](#28)\n\nAs the application grows, the original attraction goes. The layout paradox is “a\nfundamental shortcoming”.[28](#28) Long lists need `show_rows`, which takes one\nfixed row height. Rerun, the largest egui application I know of, clamps queries\nby “inspecting egui state from the previous frame”.[29](#29) Anything expensive goes\nbehind a cache keyed on your data. A cache that has to agree with your data is\nthe synchronization problem immediate mode set out to remove, now in application\ncode, one frame late.\n\n## One engine, different wiring\n\nThe harness can show this directly, because some frameworks can be wired\ncoarsely and finely on the same engine:\n\nI benchmarked some of the engines in two ways, once in the most fine grained\nway they can be used, and once in a coarser way. The results show how much there\nis to gain with fine-grained reactivity.\n\n![Tracking pays, unless the view function still has to run](/images/a-critique-of-gpui/granularity.png)![Tracking pays, unless the view function still has to run](/images/a-critique-of-gpui/granularity-dark.png)\n\nTwo things stand out. Iced’s factor is small because the view function still\nruns. And Floem’s coarse case is worth a look: every cell reads one global\nrevision signal, which is `notify` in signal clothing. It is the slowest result\non the chart. So signals do not rescue coarse state. The React team found the\nsame thing from the other side: on a benchmark with “one giant input”, a\nsignals-style runtime disappointed, and Joe Savona concluded the data model “is\njust as important, maybe more so” than the algorithm.[30](#30) The state has to be\nshaped like the reads. That is why I call this a state model problem. A good\nAPI should make it easy to align the data model with its UI projection.\n\n## Why run once\n\nSuppose you accept all of that. You want the framework to track reads, and you\nwant state shaped to match. What is the simplest API?\n\n```\npub fn sidebar(threads: RwSignal<Vec<Thread>>) -> impl IntoView {\n    // Runs once, when the sidebar mounts.\n    let unread = Memo::new(move |_| {\n        threads.with(|ts| ts.iter().filter(|t| t.unread.get()).count())\n    });\n\n    Stack::vertical((\n        Label::derived(move || format!(\"{} unread\", unread.get())),\n        dyn_stack(move || threads.get(), |t| t.id, thread_row),\n    ))\n}\n```\n\nThat is the whole thing. The body runs once. The closures you hand to the\nframework run again when something they read changes. A local variable is a\nlocal variable. There are no hook rules, no dependency arrays, no stale\nclosures and no `PartialEq` on props. Nothing reconstructs a row’s identity,\nbecause the row is still there.\n\nCompare signals with re-running components, which is Freya’s model. It works\nwell: one keystroke at 3,000 rows costs 1.2 ms. But look at a counter:[31](#31)\n\n```\n#[derive(PartialEq)]\nstruct Counter;\n\nimpl Component for Counter {\n    fn render(&self) -> impl IntoElement {\n        let mut count = use_state(|| 0);\n        // ...\n    }\n}\n```\n\n`use_state` exists because that line runs again. You now hold both models: read\ntracking decides which scope re-runs, and then re-render semantics apply inside\nit, with hooks, prop equality and a diff. Finer updates need smaller components,\nwhich is GPUI’s problem at a much lower price. What the re-running body buys is\nordinary control flow, and that is the serious objection.\n\nDan Abramov makes a compelling argument.[32](#32) Run-once puts your rendering\nlogic in closures, so top-level control flow stops working, and you group code\naround values and not around logic. “The beauty of React is that making things\n‘computed’ is an optimization, not a requirement.” He is right about it. This\ncompiles, but the first line never updates:\n\n```\nLabel::new(count.get()),               // read once; never updates\nLabel::derived(move || count.get()),   // a hole; updates\n```\n\nA reactive `if` has to become a `dyn_container`, and a `for` a `dyn_stack`.\nSolid 2.0 had to add dev warnings for top-level reads.[33](#33)\n\nBut the same comment contains the reason I land the other way. He says Solid’s\nregrouping is “Similar to how you have to restructure your code around the\nvalues when you optimize it with useMemo.” Exactly. If your application never\nneeds that, React’s model may be simpler. If it does, you pay for the\nregrouping either way, and the only choice is when: from the start, or later\nunder a profiler. Ryan Carniato’s reply is the one I agree with: “In Solid you\nalways write as if the data is derived so you don’t refactor to optimize.”[32](#32)\nOnce you know you want this precision, run-once is the API that stops\npretending otherwise. The failure modes also favour it. A forgotten hole goes\nstale on the first update, in the place you wrote it. A forgotten `notify`\ndepends on what else happened to redraw.\n\nTo be perfectly honest, the ecosystem’s wider convergence is on read tracking\nin general, and not on run-once specifically. Angular considered per-binding\nupdates and chose per-view, in writing, and it lands within about 1 ms of Solid\non a partial update.[6](#6) [34](#34) Apple and Google, who control their languages,\nkept re-running bodies with `@Observable` and Compose.[35](#35) [36](#36) A hole is\nitself a re-run scope, so what differs is how big the default scope is. Two things\nI want to note on this though:\n\n* First, those systems pay for their larger scopes with a compiler. Compose has\n  a compiler plugin, Angular compiles templates, and React’s compiler is the\n  serious rival to everything here: it keeps React’s API and removes many\n  needless re-renders, with loads up to 12% better.[37](#37) For Rust, I suspect that\n  most people that prefer immediate mode or elm (or whatever GPUI is) would not\n  like the idea of an additional compiler. A proc macro only sees tokens, not\n  types, and `render` is an arbitrary function, so there is no pass that can\n  split it into scopes. What Rust can express cheaply is a closure.\n* Second, their own guidance keeps describing the same problem: “Defer reads as\n  long as possible” for Compose, and “Unnecessary view body updates can really\n  add up” for SwiftUI.[38](#38) [39](#39) A framework that runs the body once removes\n  that category at component level.\n\nView-level rerun and fine-grained signals can have the same performance\nceiling. But signals encourage fine-grained state projections and memoization\nfrom the beginning, for view-level rerun its an explicit choice that often\nleads to more boilerplate.\n\n## Signals do not automatically make your app fast\n\nFine-grained reactivity does not make an app fast on its own.\n\n![Signals alone do not flatten the curve](/images/a-critique-of-gpui/models.png)![Signals alone do not flatten the curve](/images/a-critique-of-gpui/models-dark.png)\n\nFloem’s reactivity does exactly what it promises. Changing a label runs 5\neffects and spends 0.01 ms in reactive work, then about 14 ms in layout, because\nTaffy does not know that one leaf moved. (Floem also has a known bug where that\nedit never repaints, so treat this as a floor.) Vizia runs 4 bindings, then\nwalks all 120,091 entities, for 46 ms. Slint writes an equal value in 4 µs, and\ntakes 172 ms for a label, in a pass that walks about 30,000 items. Freya\nproduces 5 mutations, then visits 57,050 layout nodes to recompute 14. GPUI\nbeats most of them on this edit.\n\nThis is the distinction the argument depends on. All of those linear costs are\nin the engine respectively. Nothing in the application’s code requires them, so\nthey can be fixed behind the same API without changing an application. zgui\nshows how far that goes: 0.69 ms for the label at 3,000 rows and about 0.26 ms\nper 1,000 rows, around 12 times flatter than GPUI. It is still not flat, and it\nis my framework and was tuned on this harness, so take these numbers with a\ngrain of salt. In Iced and egui the linear cost is in the contract: the API\nsays your code runs. No engine work can remove that, and app code has to\nchange. GPUI probably sits somewhere in between, which is why gpui-fast can\nimprove the situation to some extent.\n\nAt this point, I wan’t to share a more detailed benchmark matrix. Read the\nre-running columns down the first five rows and they barely move, because they\ndo not depend on the edit. The signal columns move a lot, because the\nunderlying implementations differ.\n\n![Re-running makes most edits cost the same. Signals do not](/images/a-critique-of-gpui/comparison.png)![Re-running makes most edits cost the same. Signals do not](/images/a-critique-of-gpui/comparison-dark.png)\n\nThe bottom of that grid is also where the cost signals have becomes visible.\n\n* **Creation.** Filtering at 3,000 live rows takes 56 ms in Iced, 67 in egui\n  and 123 in GPUI, against 371 in zgui, 835 in Floem and 982 in Freya. On a\n  virtualized list it is 1.0 ms in Iced and 7.2 in zgui. “Setting up the\n  dependency graph is not free.”[6](#6)\n* **Memory.** Resident memory usage for large scenes is generally higher the\n  more a framework retains.\n* **Effects.** Facebook moved away from two-way binding because “cascading\n  updates” became hard to predict.[40](#40) That history is true, and Angular’s docs\n  still say “Effects should be the last API you reach for.”[41](#41) Modern graphs\n  are glitch-free. Careless effects are still difficult to reason about and\n  quickly result in feedback loops or similar stuff.\n* **Rust.** Signals rely on arena handles and `move` closures. Levien thinks\n  such patterns “adapt poorly to Rust”.[3](#3) I think they adapt well enough, and\n  GPUI’s entities are arena handles too, but, admittedly, it is not a free lunch.\n\n## Conclusion\n\nGPUI makes a full frame realitively cheap, and that makes it probably *good\nenough* for many use-cases. It is certainly enough for an editor whose\nexpensive surface is handled by hand. For a large application it leaves a\nchoice: keep the API people like and pay per view, or get precision by writing\na signal graph out of entities. Elm and immediate mode have the same problem.\nEach is clearest in the small, and each loses the thing it was chosen for as\nprecision becomes necessary, and, from my personal experience, that happens faster\nthan people expect.\n\nTracked reads are where most of the field has ended up, whatever it started\nfrom. If that is where we are going, I think we should start there, and make\nthe component a function that runs once.\n\n## Method\n\n* Numbers are medians of apply and settle from my unpublished harness, on one\n  machine: i9-13900K, RTX 3080 Ti, Vulkan, Linux. Windows, compositor and input\n  are not included. Frameworks’ maintainers have not reviewed the adapters.\n* GPUI is at `ddc9eda925` and gpui-fast at `86a8228229`. zgui is at `082337db`.\n  These were through September and November 2026, as the best of three passes.\n* Cells marked † in the grid failed their correctness oracle: Floem’s label and\n  keystroke edits, as noted above, and Slint’s font size. Every other charted\n  cell passed.\n* The 60-panel results are gpui-fast’s `retained_bench` with my additions, in\n  test mode, so no GPU work is included. Retention off there is still gpui-fast.\n* Figures from Zed’s plan are its authors’, from experimental branches.\n* Rust examples were type-checked against the vendored frameworks. Vizia’s and\n  Freya’s come from their own sources, shortened.\n\n## References\n\n1\n\n[Stanislav Vishnevskiy (Discord CTO), post on X, 2026-11-04.](https://x.com/svishnevskiy/status/2118081920194203799)\n\n2\n\n[zed#46758, gpui: Remove blade, reimplement linux renderer with wgpu, merged 2026-02-13.](https://github.com/zed-industries/zed/pull/46758)\n\n3\n\n[Raph Levien, Xilem: an architecture for UI in Rust, 2022-05-07.](https://raphlinus.github.io/rust/gui/2022/05/07/ui-architecture.html)\n\n4\n\n[GPUI README, commit ddc9eda925.](https://github.com/zed-industries/zed/blob/ddc9eda925/crates/gpui/README.md)\n\n5\n\n[GPUI source, commit ddc9eda925: crates/gpui/src/app/context.rs:216.](https://github.com/zed-industries/zed/blob/ddc9eda925/crates/gpui/src/app/context.rs#L216)\n\n6\n\n[Angular, Sub-RFC 1: Signals for Angular Reactivity, 2023-04-03.](https://github.com/angular/angular/discussions/49684)\n\n7\n\n[zed#63800, gpui: Incremental view rendering with a view tree, draft, closed 2026-09-24.](https://github.com/zed-industries/zed/pull/63800)\n\n8\n\n[crates/gpui/docs/retained\\_extraction\\_plan.md, Zed branch gpui-retained-plan, commit 312a04c83, 2026-10-30.](https://github.com/zed-industries/zed/blob/312a04c83/crates/gpui/docs/retained_extraction_plan.md)\n\n9\n\n[gpui-fast README, Longbridge, commit 86a8228229.](https://github.com/longbridge/gpui-fast/blob/86a8228229/README.md)\n\n10\n\n[Redux Style Guide.](https://redux.js.org/style-guide/)\n\n11\n\n[MobX, Optimizing React component rendering.](https://mobx.js.org/react-optimizations.html)\n\n12\n\n[crates/gpui/docs/view\\_tree.md, Zed branch gpui-retained-node-engine, commit c15d4b8e4b.](https://github.com/zed-industries/zed/blob/c15d4b8e4b/crates/gpui/docs/view_tree.md)\n\n13\n\n[Richard Feldman on The Changelog #319, 2018-10-17.](https://changelog.com/podcast/319)\n\n14\n\n[Michael Murphy (System76), Hacker News comment, 2024-04-25.](https://news.ycombinator.com/item?id=40157176)\n\n15\n\n[An Elm guide, Structure, webapps chapter.](https://guide.elm-lang.org/webapps/structure)\n\n16\n\n[Iced source, commit 8b8e6198: src/lib.rs, Scaling Applications.](https://github.com/iced-rs/iced/blob/8b8e6198/src/lib.rs)\n\n17\n\n[Héctor Ramón, iced#995, 2021-09-13.](https://github.com/iced-rs/iced/issues/995)\n\n18\n\n[cosmic-files at 3868a8e: src/app.rs and src/tab.rs. Counts are approximate.](https://github.com/pop-os/cosmic-files/tree/3868a8e)\n\n19\n\n[Evan Czaplicki, The Perfect Bug Report, 2016-11-14.](https://github.com/elm/elm-lang.org/blob/master/pages/news/the-perfect-bug-report.elm)\n\n20\n\n[Redux, Normalizing State Shape.](https://redux.js.org/usage/structuring-reducers/normalizing-state-shape)\n\n21\n\n[Redux, Deriving Data with Selectors.](https://redux.js.org/usage/deriving-data-selectors)\n\n22\n\n[Redux, Why Redux Toolkit is How To Use Redux Today.](https://redux.js.org/introduction/why-rtk-is-redux-today)\n\n23\n\n[Svelte team, Introducing runes, 2023-09-20.](https://svelte.dev/blog/runes)\n\n24\n\n[Legend-State, Fine-grained reactivity.](https://legendapp.com/open-source/state/v3/react/fine-grained-reactivity/)\n\n25\n\n[Iced source, commit 8b8e6198: examples/lazy/src/main.rs, lines 12, 127-143, 155.](https://github.com/iced-rs/iced/blob/8b8e6198/examples/lazy/src/main.rs)\n\n26\n\n[Vizia, Migration Guide: Lens-Based State to Signals, commit 426d2e7b.](https://github.com/vizia/vizia/blob/426d2e7b/MIGRATION_LENS_TO_SIGNALS.md)\n\n27\n\n[Vizia, examples/7GUIs/counter.rs, commit 426d2e7b.](https://github.com/vizia/vizia/blob/426d2e7b/examples/7GUIs/counter.rs)\n\n28\n\n[egui README, commit 7809b4fd9a.](https://github.com/emilk/egui/blob/7809b4fd9a/README.md)\n\n29\n\n[rerun#7562, 2024-10-02.](https://github.com/rerun-io/rerun/issues/7562)\n\n30\n\n[Joe Savona, Exploring React Performance, React Conf 2025.](https://www.youtube.com/watch?v=uAmRtE52mYk)\n\n31\n\n[Freya, crates/freya/src/\\_docs/state\\_management.rs, commit bf825f73.](https://github.com/marc2332/freya/blob/bf825f73/crates/freya/src/_docs/state_management.rs)\n\n32\n\n[Dan Abramov and Ryan Carniato, comments on React vs Signals: 10 Years Later, 2023-03-01.](https://dev.to/this-is-learning/react-vs-signals-10-years-later-3k71)\n\n33\n\n[Solid 2.0 beta notes, 2026-03-03.](https://github.com/solidjs/solid/discussions/2596)\n\n34\n\n[js-framework-benchmark, results of 2026-11-02, partial update. Fixture is a flat list.](https://github.com/krausest/js-framework-benchmark)\n\n35\n\n[Apple, Discover Observation in SwiftUI, WWDC23.](https://developer.apple.com/videos/play/wwdc2023/10149/)\n\n36\n\n[Android Developers, Lifecycle of composables.](https://developer.android.com/develop/ui/compose/lifecycle)\n\n37\n\n[React Compiler v1.0, 2025-10-07.](https://react.dev/blog/2025/10/07/react-compiler-1)\n\n38\n\n[Android Developers, Compose performance best practices.](https://developer.android.com/develop/ui/compose/performance/bestpractices)\n\n39\n\n[Apple, Optimize SwiftUI performance with Instruments, WWDC25.](https://developer.apple.com/videos/play/wwdc2025/306)\n\n40\n\n[Facebook, Flux in-depth overview (archived).](https://facebookarchive.github.io/flux/docs/in-depth-overview/)\n\n41\n\n[Angular, Effects guide.](https://angular.dev/guide/signals/effect)","body_html":"<h1 id=\"a-critique-of-gpui\">A Critique of GPUI</h1>\n<p>Recently, there has been a trend of more desktop GUI apps being built using\nnative rust GUI frameworks. And there are now even well known electron apps\ngetting official rewrites: Discord announced their app is being rewritten using\nGPUI.&lt;sup&gt;<a href=\"#1\">1</a>&lt;/sup&gt; Meanwhile, a lot of the LLM-clones being published seem to choose\negui. In this post, I want to explain why I am not sure those frameworks are a\ngood foundation to build on.</p>\n<p>To put it plainly: I believe both GPUI’s and egui’s state models are dead ends for complex desktop applications. Both are impressive projects, and they have their place. Zed genuinely feels fast and nice to use, and I use egui myself for debug interfaces in bevy games. But I don’t think those frameworks should be the default choice for native desktop apps.</p>\n<p>I want to make two arguments:</p>\n<ul><li>Every UI architecture ends up needing to know what changed and who depends on it, or performance characteristics will not scale. A framework whose state model cannot say so makes the application say it by hand, at the cost of whatever made that framework’s API semantics attractive in the first place.</li><li>Once you admit you want that precision, components that run once, with signals and reactive holes, are the simplest API for it.</li></ul>\n<p>*Disclosure: I ported GPUI’s current Linux renderer to wgpu&lt;sup&gt;<a href=\"#2\">2</a>&lt;/sup&gt;, I built the\nbenchmark harness used below, and I work on\n<a href=\"https://github.com/zortax/zgui\" rel=\"nofollow ugc noopener\">zgui</a>, a signal-based Rust framework that\nappears in the charts.*</p>\n<h2 id=\"the-only-question-that-matters\">The only question that matters</h2>\n<p>Raph Levien quotes Ron Minsky: “hidden inside of every UI framework is some\nkind of incrementalization framework.”<a href=\"#3\">3</a> A UI is a function of state, and\nstate changes a little at a time. But if that function becomes expensive, you\nmight want to start looking for ways to derive a faster way to update pixels on\nthe screen from an incremental state change. So every framework has to answer\none question: when one value changes, what runs?</p>\n<div class=\"table-wrap\"><table><thead><tr><th>Model</th><th>What a write runs</th><th>Who finds the change</th></tr></thead><tbody><tr><td>Immediate (egui)</td><td>All UI code, next frame</td><td>Nobody</td></tr><tr><td>Elm (Iced)</td><td>All of <code>view</code>, then a diff</td><td>The diff</td></tr><tr><td>Views (GPUI)</td><td>Every view without a cache</td><td>You, with <code>notify</code></td></tr><tr><td>Signals, re-run (Freya, Compose)</td><td>Components that read it</td><td>The framework</td></tr><tr><td>Signals, run once (Floem, Solid, zgui)</td><td>Closures that read it</td><td>The framework</td></tr></tbody></table></div>\n<p>I understand why people like the first three. No state to synchronize, one\nplace where state lives, a <code>render</code> function that is plain Rust, no macros or\nseparate compiler. I’m gonna make the argument that these approaches don’t\nscale, and fixing the underlying problem defeats what makes these models\nsimple and easy to reason about.</p>\n<h2 id=\"gpui-notify-is-zone-js\">GPUI: <code>notify</code> is zone.js</h2>\n<p>GPUI calls itself “a hybrid immediate and retained mode” framework.<a href=\"#4\">4</a> It\nretains state in entities. The UI is defined in <code>render</code> functions, changing\nstate must trigger a rerun.</p>\n<pre><code>impl Render for Sidebar {\n    fn render(\n        &amp;mut self,\n        _: &amp;mut Window,\n        cx: &amp;mut Context&lt;Self&gt;,\n    ) -&gt; impl IntoElement {\n        let inbox = self.inbox.read(cx);\n        div()\n            .child(format!(&quot;{} unread&quot;, inbox.unread()))\n            .children(inbox.threads.iter().map(|t| t.title.clone()))\n    }\n}</code></pre>\n<p>It is ordinary Rust. You can use <code>if</code>, <code>for</code> and local variables, and there\naren’t any weird wrappers. State changes require an explicit notification:</p>\n<pre><code>self.threads[i].unread = false;\ncx.notify();</code></pre>\n<p><code>notify</code> carries the entity id.<a href=\"#5\">5</a> Since Rust doesn’t have a write barrier on\n<code>&amp;mut</code>, GPUI cannot see which field changed (or whether anything changed at\nall). The Angular team wrote this about zone.js in 2023: it “is only capable of\nnotifying us when something <em>might</em> have happened”, and “This approach has not\nscaled well.”<a href=\"#6\">6</a> <code>notify</code> is more precise than a zone, since it names an\nentity, but ultimately it makes the same kind of statement. Below that id, GPUI\nknows nothing, so it re-renders every view that is not behind a valid\n<code>.cached()</code> boundary. And in practice, GPUI often rerender every view, because\n<code>.cached()</code> is rarely used by application authors, and imposes certain\nrestrictions on layout semantics.</p>\n<p>GPUI has a reputation of being “fast”. And while constants might be relatively\nlow, asymptotically, it is leaving a lot on the table. So I ran a few benchmarks,\nthat specifically test how much a sparse state change in a large UI actually costs.</p>\n<p>At 3,000 live rows with a cached view per row, changing one label takes 8.4 ms.\nA hover, a keystroke and writing a value equal to the old one all cost about\nthe same, because the cost follows the tree and not the change. It grows by\nabout 3 ms per 1,000 live rows. Write the rows as plain elements, as in the\ncode above, and the same label takes 92 ms. A hand-written equality guard takes\nthe equal write from 7.9 ms to 0.9 µs (demonstrating how much is left for each\ncall site to find).</p>\n<p>On a linear axis, the cost per row is the slopeOn a linear axis, the cost per row is the slope</p>\n<p>This doesn’t mean that every GPUI app is slow, but it shows the limit of the\nstate model. Especially with more expensive layout, you <em>do hit</em> this wall\nin practice. Zed might feel fast, but the truth is that Zed is a relatively\nsimple app, UI wise. The app’s chrome contains a few buttons, in a simple\nlayout, a sidebar and a text editor, and the text editor is implemented as a\ncustom element, completely bypassing GPUI’s layout and view semantics. By their\nown account, a window “has tens of nodes and a few thousand elements”.<a href=\"#7\">7</a></p>\n<h2 id=\"making-gpui-precise-defeats-gpui\">Making GPUI precise defeats GPUI</h2>\n<p>The obvious fix is to retain more. Zed has experimental branches for this, and\nLongbridge’s gpui-fast is a fork that keeps every view’s subtree between\nframes.<a href=\"#8\">8</a> <a href=\"#9\">9</a> It works, within a limit: the smallest thing either one can\nreuse is a view. So to update one label without rebuilding the sidebar, the\nlabel has to be a view:</p>\n<pre><code>pub struct UnreadBadge { unread: usize, _watch: Subscription }\n\nimpl UnreadBadge {\n    pub fn new(inbox: Entity&lt;Inbox&gt;, cx: &amp;mut Context&lt;Self&gt;) -&gt; Self {\n        let unread = inbox.read(cx).unread();\n        let _watch = cx.observe(&amp;inbox, |this, inbox, cx| {\n            let unread = inbox.read(cx).unread();\n            if unread != this.unread {\n                this.unread = unread;\n                cx.notify();\n            }\n        });\n        Self { unread, _watch }\n    }\n}\n\nimpl Render for UnreadBadge {\n    fn render(\n        &amp;mut self,\n        _: &amp;mut Window,\n        _: &amp;mut Context&lt;Self&gt;,\n    ) -&gt; impl IntoElement {\n        format!(&quot;{} unread&quot;, self.unread)\n    }\n}</code></pre>\n<p>Its owner then has to create it and keep the handle:</p>\n<pre><code>let badge = cx.new(|cx| UnreadBadge::new(inbox.clone(), cx));</code></pre>\n<p>That is an entity, a <code>Render</code> impl, a subscription, a stored copy of the value,\na hand-written guard and an owner, all to express that one label depends on one\ncount. In a signal framework it is this:</p>\n<pre><code>let unread = Memo::new(move |_| {\n    threads.with(|ts| ts.iter().filter(|t| t.unread.get()).count())\n});\nLabel::derived(move || format!(&quot;{} unread&quot;, unread.get()))</code></pre>\n<p>The rest of GPUI’s API works against this too. <code>Render</code> takes no props, so\nparents push values into child entities during their own render. <code>RenderOnce</code>\ncomponents, which is what buttons and rows are, draw inside their parent’s view\nand are no boundary at all. List rows are closures, so a row view means\nmanaging a keyed map of entities by hand.</p>\n<p>And it only helps where state happens to line up with views. I reran gpui-fast’s\nown 60-panel benchmark, drew each frame once, and then moved the state:</p>\n<p>Retention pays only where state already matches the viewsRetention pays only where state already matches the views</p>\n<p>With state owned by each panel, one change saves 83%. With a shared model,\nretention makes the same frame 11% slower. The window and the edit are\nidentical. In real Zed, the Zed team measured retention “1–3% slower than off\non ordinary workloads”, found that “Most of the real-Zed win” came from other\nwork, and warned that “microbenchmark wins didn’t predict real-Zed\nresults”.<a href=\"#8\">8</a> gpui-fast is real progress and costs little to adopt: it takes\nthe 3,000-row label from 8.4 to 3.4 ms. But that frame renders three views and\nlays out one element, and still spends 3.4 ms, because the frame is still a\nwalk over the whole tree.</p>\n<p>The web has already walked this road. Redux’s style guide says “Prefer having\nmore UI components subscribed to the Redux store and reading data at a more\ngranular level”.<a href=\"#10\">10</a> MobX says to “create lots of small observer\ncomponents”.<a href=\"#11\">11</a> Both tell you to make a boundary per projection, manually,\nbecause the framework can’t infer it.</p>\n<p>This is the part I find hardest to get past. People choose GPUI because <code>render</code>\nis a plain function of state. A UI where each projection is a separately owned\nentity with a subscription and a guard is no longer that. It is a signal graph\nbuilt by hand from much heavier parts, where a missed edge is silent. Zed’s own\ndesign note says “Missing notifications are application bugs”.<a href=\"#12\">12</a> Keep the\npleasant API and you get view-sized updates. Take the precision and you lose the\npleasant API. A signals crate on top would not change the trade, because its\nsmallest sink is still a view. Reaching one node with no <code>render</code> running needs\nwrites the framework can see and nodes that outlive a frame, and that means a\nnew state model and a new element contract.</p>\n<h2 id=\"elm-deceptively-simple-at-small-scales\">Elm: deceptively simple at small scales</h2>\n<p>At the size it is usually shown, the Elm architecture is a deceptively simple\nUI model: one state value, one <code>update</code>, one <code>view</code>, and every change has a\nname. While large applications do use it successully,<a href=\"#13\">13</a> <a href=\"#14\">14</a> I do want to\nmake the point that this clarity belongs to the small case, and in a complex\napplication signals and stores are arguably easier to reason about.</p>\n<p>Take the same <code>unread</code> count. It has to be right after every message, so either\n<code>view</code> recomputes it on every update or <code>update</code> maintains it:</p>\n<pre><code>match message {\n    InboxMessage::MarkRead(i) =&gt; {\n        if self.threads[i].unread {\n            self.threads[i].unread = false;\n            self.unread -= 1;\n        }\n    }\n    InboxMessage::Delete(i) =&gt; {\n        if self.threads.remove(i).unread {\n            self.unread -= 1;\n        }\n    }\n    InboxMessage::Arrived(thread) =&gt; {\n        self.unread += thread.unread as usize;\n        self.threads.push(thread);\n    }\n}</code></pre>\n<p>The definition of <code>unread</code> is now nowhere in particular. It is spread across\nevery arm that touches a thread, and each new message has to remember it. The\ncompiler checks that the <code>match</code> is exhaustive, but it does not check the\narithmetic. The memo above has one definition, and a new writer cannot forget\nit.</p>\n<p>The same thing happens with location. Where does a hover state or a half-typed\ndraft live? Single source of truth says in the model, with a message type\nrouted down and an outcome routed back up. Elm’s guide: “Actively trying to\nmake components is a recipe for disaster in Elm.”<a href=\"#15\">15</a>. Iced recommends\nreturning an <code>Action</code> to the parent.<a href=\"#16\">16</a> Iced’s maintainer says components in\nthis architecture always end “with pain”, and also makes the best case for the\ndiscipline: avoiding them “forces you to think hard about your data\nmodel”.<a href=\"#17\">17</a> Okay, I guess that’s a fair argument. But cosmic-files has 136\ntop-level message variants and 73 more for a tab, plus a <code>Tab::update</code> that\nreturns commands for the parent to interpret.<a href=\"#18\">18</a> Everything in that is\nexplicit, and none of it is simple.</p>\n<p>The architecture also has the same issue GPUI has. The <code>update</code> implementation\ntells you what a message writes, it cannot tell you what read the field.\nAnything inside the <code>view</code> might. Elm’s architecture doesn’t answer “what\nchanged?”, it answers “what happened?”. Session export might be useful in some\nscenarios, but it is not useful for scalable performance characteristics.<a href=\"#19\">19</a></p>\n<p>This is what I read in the web’s history. Redux is the best-known relative of\nthis design, and its docs read like a field report. Treat a portion of your\nstore “as if it were a database”.<a href=\"#20\">20</a> Selectors “will be re-run after every\ndispatched action”.<a href=\"#21\">21</a> The core package is “obsolete”, replaced by a toolkit\nmade to remove boilerplate.<a href=\"#22\">22</a> Outside React, the mainstream has moved to\ntracked reads. Angular, Vue, Svelte and Solid build on signals or something\nequivalent, Preact offers them, and Svelte’s team put it this way: “we’ve come\nto the realisation that Knockout was right all along.”<a href=\"#23\">23</a> Inside React, Jotai\nand MobX bring tracking in as libraries, and Legend-State even offers a “render\nonce” style.<a href=\"#24\">24</a> Most applications are still on React, and React’s team\ndisagrees, which I come back to below. So the convergence is on the state model,\noutside one large exception.</p>\n<p>Performance follows the same line. Since Iced rebuilds all of <code>view</code> after\nevery batch of messages, one label at 3,000 rows builds 39,023 widgets and\ntakes 7.3 ms. <code>Lazy</code> on every row only gets that to 5.7 ms, because <code>view</code>\nstill has to visit each row to hash its key. The official <code>lazy</code> example keys\non a <code>version: u8</code> that four <code>update</code> arms bump by hand.<a href=\"#25\">25</a> That is a dirty\nflag with a nicer name. In fairness, cosmic-files and Halloy use no <code>lazy</code> at\nall, and on a virtualized list Iced is one of the fastest frameworks I\nmeasured, at 0.19 ms. A bounded screen rebuilds cheaply. But asymptotic\ncomplexity is clear. And similar to GPUI, the API semantics simply can’t\nexpress the necessary information.</p>\n<p>There is actually precedence for this: Vizia shows what happens when you add\nprecision to this model. It moved from lenses to signals in March 2026 and kept\nits <code>Model</code> and event dispatch.<a href=\"#26\">26</a> This is its counter, shortened:<a href=\"#27\">27</a></p>\n<pre><code>pub enum AppEvent {\n    Increment,\n}\n\nimpl Model for AppData {\n    fn event(&amp;mut self, _: &amp;mut EventContext, event: &amp;mut Event) {\n        event.map(|app_event, _| match app_event {\n            AppEvent::Increment =&gt; self.count.update(|count| *count += 1),\n        });\n    }\n}</code></pre>\n<pre><code>let count = Signal::new(0);\nAppData { count }.build(cx);\nButton::new(cx, |cx| Label::new(cx, &quot;Increment&quot;))\n    .on_press(|cx| cx.emit(AppEvent::Increment));\nLabel::new(cx, count).width(Pixels(50.0)).live(Live::Polite);</code></pre>\n<p>The label reads the signal directly, and the same closure that builds the\nbutton created it. The enum, the dispatch and the handler exist to carry one\ncall to <code>update</code>. Vizia was never strict Elm, since its views are built once,\nand signals were a sensible move: it got per-field writes. But look at what\nremains of Elm’s reasons. State is a graph of mutable cells, <code>Model</code> is a bag\nof handles, and <code>event</code> is a <code>&amp;mut self</code> side effect. You now have two systems\nfor saying that something changed. So my objection to adding signals to the Elm\narchitecture really is the same as with GPUI: they work, and they remove what\nyou came for.</p>\n<h2 id=\"a-quick-note-on-immediate-mode\">A quick note on immediate mode</h2>\n<p>egui’s pitch is the best in the field: “You don’t have to worry about app state\nand GUI state being out-of-sync”.<a href=\"#28\">28</a> For a tool, this is hard to beat:</p>\n<pre><code>for row in rows {\n    ui.horizontal(|ui| {\n        ui.label(&amp;row.name);\n        ui.label(row.price.to_string());\n        if ui.button(&quot;+&quot;).clicked() {\n            row.price += 1;\n        }\n    });\n}</code></pre>\n<p>The price is that a frame costs the size of the UI, independent of what\nchanged. At 3,000 rows every small edit takes about 32 ms, or about 19 ms with\naccessibility off. egui’s author is candid about the trade: immediate mode is\n“easier to use, but less powerful”.<a href=\"#28\">28</a></p>\n<p>As the application grows, the original attraction goes. The layout paradox is “a\nfundamental shortcoming”.<a href=\"#28\">28</a> Long lists need <code>show_rows</code>, which takes one\nfixed row height. Rerun, the largest egui application I know of, clamps queries\nby “inspecting egui state from the previous frame”.<a href=\"#29\">29</a> Anything expensive goes\nbehind a cache keyed on your data. A cache that has to agree with your data is\nthe synchronization problem immediate mode set out to remove, now in application\ncode, one frame late.</p>\n<h2 id=\"one-engine-different-wiring\">One engine, different wiring</h2>\n<p>The harness can show this directly, because some frameworks can be wired\ncoarsely and finely on the same engine:</p>\n<p>I benchmarked some of the engines in two ways, once in the most fine grained\nway they can be used, and once in a coarser way. The results show how much there\nis to gain with fine-grained reactivity.</p>\n<p>Tracking pays, unless the view function still has to runTracking pays, unless the view function still has to run</p>\n<p>Two things stand out. Iced’s factor is small because the view function still\nruns. And Floem’s coarse case is worth a look: every cell reads one global\nrevision signal, which is <code>notify</code> in signal clothing. It is the slowest result\non the chart. So signals do not rescue coarse state. The React team found the\nsame thing from the other side: on a benchmark with “one giant input”, a\nsignals-style runtime disappointed, and Joe Savona concluded the data model “is\njust as important, maybe more so” than the algorithm.<a href=\"#30\">30</a> The state has to be\nshaped like the reads. That is why I call this a state model problem. A good\nAPI should make it easy to align the data model with its UI projection.</p>\n<h2 id=\"why-run-once\">Why run once</h2>\n<p>Suppose you accept all of that. You want the framework to track reads, and you\nwant state shaped to match. What is the simplest API?</p>\n<pre><code>pub fn sidebar(threads: RwSignal&lt;Vec&lt;Thread&gt;&gt;) -&gt; impl IntoView {\n    // Runs once, when the sidebar mounts.\n    let unread = Memo::new(move |_| {\n        threads.with(|ts| ts.iter().filter(|t| t.unread.get()).count())\n    });\n\n    Stack::vertical((\n        Label::derived(move || format!(&quot;{} unread&quot;, unread.get())),\n        dyn_stack(move || threads.get(), |t| t.id, thread_row),\n    ))\n}</code></pre>\n<p>That is the whole thing. The body runs once. The closures you hand to the\nframework run again when something they read changes. A local variable is a\nlocal variable. There are no hook rules, no dependency arrays, no stale\nclosures and no <code>PartialEq</code> on props. Nothing reconstructs a row’s identity,\nbecause the row is still there.</p>\n<p>Compare signals with re-running components, which is Freya’s model. It works\nwell: one keystroke at 3,000 rows costs 1.2 ms. But look at a counter:<a href=\"#31\">31</a></p>\n<pre><code>#[derive(PartialEq)]\nstruct Counter;\n\nimpl Component for Counter {\n    fn render(&amp;self) -&gt; impl IntoElement {\n        let mut count = use_state(|| 0);\n        // ...\n    }\n}</code></pre>\n<p><code>use_state</code> exists because that line runs again. You now hold both models: read\ntracking decides which scope re-runs, and then re-render semantics apply inside\nit, with hooks, prop equality and a diff. Finer updates need smaller components,\nwhich is GPUI’s problem at a much lower price. What the re-running body buys is\nordinary control flow, and that is the serious objection.</p>\n<p>Dan Abramov makes a compelling argument.<a href=\"#32\">32</a> Run-once puts your rendering\nlogic in closures, so top-level control flow stops working, and you group code\naround values and not around logic. “The beauty of React is that making things\n‘computed’ is an optimization, not a requirement.” He is right about it. This\ncompiles, but the first line never updates:</p>\n<pre><code>Label::new(count.get()),               // read once; never updates\nLabel::derived(move || count.get()),   // a hole; updates</code></pre>\n<p>A reactive <code>if</code> has to become a <code>dyn_container</code>, and a <code>for</code> a <code>dyn_stack</code>.\nSolid 2.0 had to add dev warnings for top-level reads.<a href=\"#33\">33</a></p>\n<p>But the same comment contains the reason I land the other way. He says Solid’s\nregrouping is “Similar to how you have to restructure your code around the\nvalues when you optimize it with useMemo.” Exactly. If your application never\nneeds that, React’s model may be simpler. If it does, you pay for the\nregrouping either way, and the only choice is when: from the start, or later\nunder a profiler. Ryan Carniato’s reply is the one I agree with: “In Solid you\nalways write as if the data is derived so you don’t refactor to optimize.”<a href=\"#32\">32</a>\nOnce you know you want this precision, run-once is the API that stops\npretending otherwise. The failure modes also favour it. A forgotten hole goes\nstale on the first update, in the place you wrote it. A forgotten <code>notify</code>\ndepends on what else happened to redraw.</p>\n<p>To be perfectly honest, the ecosystem’s wider convergence is on read tracking\nin general, and not on run-once specifically. Angular considered per-binding\nupdates and chose per-view, in writing, and it lands within about 1 ms of Solid\non a partial update.<a href=\"#6\">6</a> <a href=\"#34\">34</a> Apple and Google, who control their languages,\nkept re-running bodies with <code>@Observable</code> and Compose.<a href=\"#35\">35</a> <a href=\"#36\">36</a> A hole is\nitself a re-run scope, so what differs is how big the default scope is. Two things\nI want to note on this though:</p>\n<ul><li><p>First, those systems pay for their larger scopes with a compiler. Compose has</p><p>a compiler plugin, Angular compiles templates, and React’s compiler is the\nserious rival to everything here: it keeps React’s API and removes many\nneedless re-renders, with loads up to 12% better.<a href=\"#37\">37</a> For Rust, I suspect that\nmost people that prefer immediate mode or elm (or whatever GPUI is) would not\nlike the idea of an additional compiler. A proc macro only sees tokens, not\ntypes, and <code>render</code> is an arbitrary function, so there is no pass that can\nsplit it into scopes. What Rust can express cheaply is a closure.</p></li><li><p>Second, their own guidance keeps describing the same problem: “Defer reads as</p><p>long as possible” for Compose, and “Unnecessary view body updates can really\nadd up” for SwiftUI.<a href=\"#38\">38</a> <a href=\"#39\">39</a> A framework that runs the body once removes\nthat category at component level.</p></li></ul>\n<p>View-level rerun and fine-grained signals can have the same performance\nceiling. But signals encourage fine-grained state projections and memoization\nfrom the beginning, for view-level rerun its an explicit choice that often\nleads to more boilerplate.</p>\n<h2 id=\"signals-do-not-automatically-make-your-app-fast\">Signals do not automatically make your app fast</h2>\n<p>Fine-grained reactivity does not make an app fast on its own.</p>\n<p>Signals alone do not flatten the curveSignals alone do not flatten the curve</p>\n<p>Floem’s reactivity does exactly what it promises. Changing a label runs 5\neffects and spends 0.01 ms in reactive work, then about 14 ms in layout, because\nTaffy does not know that one leaf moved. (Floem also has a known bug where that\nedit never repaints, so treat this as a floor.) Vizia runs 4 bindings, then\nwalks all 120,091 entities, for 46 ms. Slint writes an equal value in 4 µs, and\ntakes 172 ms for a label, in a pass that walks about 30,000 items. Freya\nproduces 5 mutations, then visits 57,050 layout nodes to recompute 14. GPUI\nbeats most of them on this edit.</p>\n<p>This is the distinction the argument depends on. All of those linear costs are\nin the engine respectively. Nothing in the application’s code requires them, so\nthey can be fixed behind the same API without changing an application. zgui\nshows how far that goes: 0.69 ms for the label at 3,000 rows and about 0.26 ms\nper 1,000 rows, around 12 times flatter than GPUI. It is still not flat, and it\nis my framework and was tuned on this harness, so take these numbers with a\ngrain of salt. In Iced and egui the linear cost is in the contract: the API\nsays your code runs. No engine work can remove that, and app code has to\nchange. GPUI probably sits somewhere in between, which is why gpui-fast can\nimprove the situation to some extent.</p>\n<p>At this point, I wan’t to share a more detailed benchmark matrix. Read the\nre-running columns down the first five rows and they barely move, because they\ndo not depend on the edit. The signal columns move a lot, because the\nunderlying implementations differ.</p>\n<p>Re-running makes most edits cost the same. Signals do notRe-running makes most edits cost the same. Signals do not</p>\n<p>The bottom of that grid is also where the cost signals have becomes visible.</p>\n<ul><li><p><strong>Creation.</strong> Filtering at 3,000 live rows takes 56 ms in Iced, 67 in egui</p><p>and 123 in GPUI, against 371 in zgui, 835 in Floem and 982 in Freya. On a\nvirtualized list it is 1.0 ms in Iced and 7.2 in zgui. “Setting up the\ndependency graph is not free.”<a href=\"#6\">6</a></p></li><li><p><strong>Memory.</strong> Resident memory usage for large scenes is generally higher the</p><p>more a framework retains.</p></li><li><p><strong>Effects.</strong> Facebook moved away from two-way binding because “cascading</p><p>updates” became hard to predict.<a href=\"#40\">40</a> That history is true, and Angular’s docs\nstill say “Effects should be the last API you reach for.”<a href=\"#41\">41</a> Modern graphs\nare glitch-free. Careless effects are still difficult to reason about and\nquickly result in feedback loops or similar stuff.</p></li><li><p><strong>Rust.</strong> Signals rely on arena handles and <code>move</code> closures. Levien thinks</p><p>such patterns “adapt poorly to Rust”.<a href=\"#3\">3</a> I think they adapt well enough, and\nGPUI’s entities are arena handles too, but, admittedly, it is not a free lunch.</p></li></ul>\n<h2 id=\"conclusion\">Conclusion</h2>\n<p>GPUI makes a full frame realitively cheap, and that makes it probably *good\nenough* for many use-cases. It is certainly enough for an editor whose\nexpensive surface is handled by hand. For a large application it leaves a\nchoice: keep the API people like and pay per view, or get precision by writing\na signal graph out of entities. Elm and immediate mode have the same problem.\nEach is clearest in the small, and each loses the thing it was chosen for as\nprecision becomes necessary, and, from my personal experience, that happens faster\nthan people expect.</p>\n<p>Tracked reads are where most of the field has ended up, whatever it started\nfrom. If that is where we are going, I think we should start there, and make\nthe component a function that runs once.</p>\n<h2 id=\"method\">Method</h2>\n<ul><li><p>Numbers are medians of apply and settle from my unpublished harness, on one</p><p>machine: i9-13900K, RTX 3080 Ti, Vulkan, Linux. Windows, compositor and input\nare not included. Frameworks’ maintainers have not reviewed the adapters.</p></li><li><p>GPUI is at <code>ddc9eda925</code> and gpui-fast at <code>86a8228229</code>. zgui is at <code>082337db</code>.</p><p>These were through September and November 2026, as the best of three passes.</p></li><li><p>Cells marked † in the grid failed their correctness oracle: Floem’s label and</p><p>keystroke edits, as noted above, and Slint’s font size. Every other charted\ncell passed.</p></li><li><p>The 60-panel results are gpui-fast’s <code>retained_bench</code> with my additions, in</p><p>test mode, so no GPU work is included. Retention off there is still gpui-fast.</p></li><li>Figures from Zed’s plan are its authors’, from experimental branches.</li><li><p>Rust examples were type-checked against the vendored frameworks. Vizia’s and</p><p>Freya’s come from their own sources, shortened.</p></li></ul>\n<h2 id=\"references\">References</h2>\n<p>1</p>\n<p><a href=\"https://x.com/svishnevskiy/status/2118081920194203799\" rel=\"nofollow ugc noopener\">Stanislav Vishnevskiy (Discord CTO), post on X, 2026-11-04.</a></p>\n<p>2</p>\n<p><a href=\"https://github.com/zed-industries/zed/pull/46758\" rel=\"nofollow ugc noopener\">zed#46758, gpui: Remove blade, reimplement linux renderer with wgpu, merged 2026-02-13.</a></p>\n<p>3</p>\n<p><a href=\"https://raphlinus.github.io/rust/gui/2022/05/07/ui-architecture.html\" rel=\"nofollow ugc noopener\">Raph Levien, Xilem: an architecture for UI in Rust, 2022-05-07.</a></p>\n<p>4</p>\n<p><a href=\"https://github.com/zed-industries/zed/blob/ddc9eda925/crates/gpui/README.md\" rel=\"nofollow ugc noopener\">GPUI README, commit ddc9eda925.</a></p>\n<p>5</p>\n<p><a href=\"https://github.com/zed-industries/zed/blob/ddc9eda925/crates/gpui/src/app/context.rs#L216\" rel=\"nofollow ugc noopener\">GPUI source, commit ddc9eda925: crates/gpui/src/app/context.rs:216.</a></p>\n<p>6</p>\n<p><a href=\"https://github.com/angular/angular/discussions/49684\" rel=\"nofollow ugc noopener\">Angular, Sub-RFC 1: Signals for Angular Reactivity, 2023-04-03.</a></p>\n<p>7</p>\n<p><a href=\"https://github.com/zed-industries/zed/pull/63800\" rel=\"nofollow ugc noopener\">zed#63800, gpui: Incremental view rendering with a view tree, draft, closed 2026-09-24.</a></p>\n<p>8</p>\n<p><a href=\"https://github.com/zed-industries/zed/blob/312a04c83/crates/gpui/docs/retained_extraction_plan.md\" rel=\"nofollow ugc noopener\">crates/gpui/docs/retained_extraction_plan.md, Zed branch gpui-retained-plan, commit 312a04c83, 2026-10-30.</a></p>\n<p>9</p>\n<p><a href=\"https://github.com/longbridge/gpui-fast/blob/86a8228229/README.md\" rel=\"nofollow ugc noopener\">gpui-fast README, Longbridge, commit 86a8228229.</a></p>\n<p>10</p>\n<p><a href=\"https://redux.js.org/style-guide/\" rel=\"nofollow ugc noopener\">Redux Style Guide.</a></p>\n<p>11</p>\n<p><a href=\"https://mobx.js.org/react-optimizations.html\" rel=\"nofollow ugc noopener\">MobX, Optimizing React component rendering.</a></p>\n<p>12</p>\n<p><a href=\"https://github.com/zed-industries/zed/blob/c15d4b8e4b/crates/gpui/docs/view_tree.md\" rel=\"nofollow ugc noopener\">crates/gpui/docs/view_tree.md, Zed branch gpui-retained-node-engine, commit c15d4b8e4b.</a></p>\n<p>13</p>\n<p><a href=\"https://changelog.com/podcast/319\" rel=\"nofollow ugc noopener\">Richard Feldman on The Changelog #319, 2018-10-17.</a></p>\n<p>14</p>\n<p><a href=\"https://news.ycombinator.com/item?id=40157176\" rel=\"nofollow ugc noopener\">Michael Murphy (System76), Hacker News comment, 2024-04-25.</a></p>\n<p>15</p>\n<p><a href=\"https://guide.elm-lang.org/webapps/structure\" rel=\"nofollow ugc noopener\">An Elm guide, Structure, webapps chapter.</a></p>\n<p>16</p>\n<p><a href=\"https://github.com/iced-rs/iced/blob/8b8e6198/src/lib.rs\" rel=\"nofollow ugc noopener\">Iced source, commit 8b8e6198: src/lib.rs, Scaling Applications.</a></p>\n<p>17</p>\n<p><a href=\"https://github.com/iced-rs/iced/issues/995\" rel=\"nofollow ugc noopener\">Héctor Ramón, iced#995, 2021-09-13.</a></p>\n<p>18</p>\n<p><a href=\"https://github.com/pop-os/cosmic-files/tree/3868a8e\" rel=\"nofollow ugc noopener\">cosmic-files at 3868a8e: src/app.rs and src/tab.rs. Counts are approximate.</a></p>\n<p>19</p>\n<p><a href=\"https://github.com/elm/elm-lang.org/blob/master/pages/news/the-perfect-bug-report.elm\" rel=\"nofollow ugc noopener\">Evan Czaplicki, The Perfect Bug Report, 2016-11-14.</a></p>\n<p>20</p>\n<p><a href=\"https://redux.js.org/usage/structuring-reducers/normalizing-state-shape\" rel=\"nofollow ugc noopener\">Redux, Normalizing State Shape.</a></p>\n<p>21</p>\n<p><a href=\"https://redux.js.org/usage/deriving-data-selectors\" rel=\"nofollow ugc noopener\">Redux, Deriving Data with Selectors.</a></p>\n<p>22</p>\n<p><a href=\"https://redux.js.org/introduction/why-rtk-is-redux-today\" rel=\"nofollow ugc noopener\">Redux, Why Redux Toolkit is How To Use Redux Today.</a></p>\n<p>23</p>\n<p><a href=\"https://svelte.dev/blog/runes\" rel=\"nofollow ugc noopener\">Svelte team, Introducing runes, 2023-09-20.</a></p>\n<p>24</p>\n<p><a href=\"https://legendapp.com/open-source/state/v3/react/fine-grained-reactivity/\" rel=\"nofollow ugc noopener\">Legend-State, Fine-grained reactivity.</a></p>\n<p>25</p>\n<p><a href=\"https://github.com/iced-rs/iced/blob/8b8e6198/examples/lazy/src/main.rs\" rel=\"nofollow ugc noopener\">Iced source, commit 8b8e6198: examples/lazy/src/main.rs, lines 12, 127-143, 155.</a></p>\n<p>26</p>\n<p><a href=\"https://github.com/vizia/vizia/blob/426d2e7b/MIGRATION_LENS_TO_SIGNALS.md\" rel=\"nofollow ugc noopener\">Vizia, Migration Guide: Lens-Based State to Signals, commit 426d2e7b.</a></p>\n<p>27</p>\n<p><a href=\"https://github.com/vizia/vizia/blob/426d2e7b/examples/7GUIs/counter.rs\" rel=\"nofollow ugc noopener\">Vizia, examples/7GUIs/counter.rs, commit 426d2e7b.</a></p>\n<p>28</p>\n<p><a href=\"https://github.com/emilk/egui/blob/7809b4fd9a/README.md\" rel=\"nofollow ugc noopener\">egui README, commit 7809b4fd9a.</a></p>\n<p>29</p>\n<p><a href=\"https://github.com/rerun-io/rerun/issues/7562\" rel=\"nofollow ugc noopener\">rerun#7562, 2024-10-02.</a></p>\n<p>30</p>\n<p><a href=\"https://www.youtube.com/watch?v=uAmRtE52mYk\" rel=\"nofollow ugc noopener\">Joe Savona, Exploring React Performance, React Conf 2025.</a></p>\n<p>31</p>\n<p><a href=\"https://github.com/marc2332/freya/blob/bf825f73/crates/freya/src/_docs/state_management.rs\" rel=\"nofollow ugc noopener\">Freya, crates/freya/src/_docs/state_management.rs, commit bf825f73.</a></p>\n<p>32</p>\n<p><a href=\"https://dev.to/this-is-learning/react-vs-signals-10-years-later-3k71\" rel=\"nofollow ugc noopener\">Dan Abramov and Ryan Carniato, comments on React vs Signals: 10 Years Later, 2023-03-01.</a></p>\n<p>33</p>\n<p><a href=\"https://github.com/solidjs/solid/discussions/2596\" rel=\"nofollow ugc noopener\">Solid 2.0 beta notes, 2026-03-03.</a></p>\n<p>34</p>\n<p><a href=\"https://github.com/krausest/js-framework-benchmark\" rel=\"nofollow ugc noopener\">js-framework-benchmark, results of 2026-11-02, partial update. Fixture is a flat list.</a></p>\n<p>35</p>\n<p><a href=\"https://developer.apple.com/videos/play/wwdc2023/10149/\" rel=\"nofollow ugc noopener\">Apple, Discover Observation in SwiftUI, WWDC23.</a></p>\n<p>36</p>\n<p><a href=\"https://developer.android.com/develop/ui/compose/lifecycle\" rel=\"nofollow ugc noopener\">Android Developers, Lifecycle of composables.</a></p>\n<p>37</p>\n<p><a href=\"https://react.dev/blog/2025/10/07/react-compiler-1\" rel=\"nofollow ugc noopener\">React Compiler v1.0, 2025-10-07.</a></p>\n<p>38</p>\n<p><a href=\"https://developer.android.com/develop/ui/compose/performance/bestpractices\" rel=\"nofollow ugc noopener\">Android Developers, Compose performance best practices.</a></p>\n<p>39</p>\n<p><a href=\"https://developer.apple.com/videos/play/wwdc2025/306\" rel=\"nofollow ugc noopener\">Apple, Optimize SwiftUI performance with Instruments, WWDC25.</a></p>\n<p>40</p>\n<p><a href=\"https://facebookarchive.github.io/flux/docs/in-depth-overview/\" rel=\"nofollow ugc noopener\">Facebook, Flux in-depth overview (archived).</a></p>\n<p>41</p>\n<p><a href=\"https://angular.dev/guide/signals/effect\" rel=\"nofollow ugc noopener\">Angular, Effects guide.</a></p>","headings":[{"level":1,"text":"A Critique of GPUI","id":"a-critique-of-gpui"},{"level":2,"text":"The only question that matters","id":"the-only-question-that-matters"},{"level":2,"text":"GPUI: notify is zone.js","id":"gpui-notify-is-zone-js"},{"level":2,"text":"Making GPUI precise defeats GPUI","id":"making-gpui-precise-defeats-gpui"},{"level":2,"text":"Elm: deceptively simple at small scales","id":"elm-deceptively-simple-at-small-scales"},{"level":2,"text":"A quick note on immediate mode","id":"a-quick-note-on-immediate-mode"},{"level":2,"text":"One engine, different wiring","id":"one-engine-different-wiring"},{"level":2,"text":"Why run once","id":"why-run-once"},{"level":2,"text":"Signals do not automatically make your app fast","id":"signals-do-not-automatically-make-your-app-fast"},{"level":2,"text":"Conclusion","id":"conclusion"},{"level":2,"text":"Method","id":"method"},{"level":2,"text":"References","id":"references"}]}}