Zed Weekly: #29
Zed's port to GPUI 2 is nearing daily usability, and the team is focused on frame-rendering performance measured by holding tab-switch at 60Hz key repeat. Because every element is a boxed trait object, they replaced malloc with a custom thread-local bump arena that enforces safety dynamically instead of via lifetimes, and changed `Element::paint` to take `&mut self` to avoid heap-to-stack copies. The target is full-window redraws under 4ms on an M1, with view caching planned next. Other updates cover a better VS Code theme importer, focus handlers moved to run after each frame draw to fix a split-pane focus bug, and a port of the feedback UI.
Related posts
- Zed Weekly: #22
Zed easyNoviceZed team members report weekly progress: GPUI is being rewritten with a ported Metal renderer that uses plane-split for primitive draw ordering, multi-threaded entity access, and a MainThread<T: Context> wrapper so native UI APIs are only called from the main thread. Channels are being reworked to separate chat-style communication from DAG-structured project notes, with unread indicators, notifications, public channels and deep links on the way. Julia split markdown parsing from rendering for completion documentation, avoiding flicker when grammars load late and speeding up rendering. Other work covers Vue LSP and tree-sitter support, CPU and memory telemetry, and a fix for a follow-loop bug in collaboration.
- Leveraging Rust and the GPU to render user interfaces at 120 FPS
Zed hardMasterZed's GPUI framework hits 120 FPS by rendering the editor UI like a video game: rather than a general-purpose 2D vector renderer (Pathfinder proved too slow), it uses dedicated GPU shaders for a small set of primitives such as rectangles, shadows, text, icons and images, all described as data on the CPU and drawn with instanced rendering. Rounded rectangles come from a signed distance function evaluated in a Metal fragment shader. Drop shadows follow Evan Wallace's approximation, which pairs a closed-form erf-based Gaussian convolution on one axis with a few samples along the other. Text uses OS shaping via CoreText, with a per-frame cache of text-font pairs so only changed text gets reshaped.
- Optimizing the Metal pipeline to maintain 120 FPS in GPUI
Zed mediumAdeptZed's GPUI renderer dropped frames on Macs running in direct (non-composited) mode because `MetalRenderer::draw` blocked the main thread with `wait_until_completed`. In direct mode that call waits for pixels to reach the frame buffer, not just the compositor's intermediate surface. Switching to `wait_until_scheduled` exposed a CPU/GPU race on the shared instance buffer, fixed with a pool of instance buffers that are returned to the pool from a command-buffer completion handler. Dropped frames under ProMotion were fixed by presenting repeated frames for one second after the last input so the display stays at 120 Hz. When macOS later capped some users at 60 FPS, the team moved to `CVDisplayLink`, presents drawables via the command buffer without `presentsWithTransaction`, and keeps the synchronous path only for app startup and window resizes.
- Zed Weekly: #25
Zed mediumAdeptZed is rewriting its UI framework as GPUI 2 and porting the whole editor onto it before open-sourcing, trading feature work for better ergonomics while keeping GPUI 1's performance. All state lives in an AppContext that acts like an application-specific heap: Model<T> handles are dereferenced through a context, and models emit and subscribe to events. View<T> wraps models whose types implement a Render trait that returns element trees. Components, Tailwind-style styling helpers, a color-scale-based theme system and a new layout engine and executor round out the design. Bottleneck crates (project, workspace, editor) made the port largely serial, so the team leaned on Rust's type system and Zed's collaborative editing to pair on it, with roughly a third to half of the app ported after two weeks.
- This Week at Zed Industries: #8
Zed easyNoviceZed's weekly team update covers work on the AI assistant panel (multi-cursor, message splitting, saved conversations), voice collaboration via GPUI, and inlay hint latency and caching. Performance fixes include lazily loading gitignored and out-of-project symlinked directories to cut memory, CPU and collaboration sync costs, and only updating the mouse cursor style when it changes, which removes an expensive per-frame cursor rasterization in the immediate-mode GPUI. The team also started work on an embedding and indexing engine for semantic navigation, and is considering moving GPUI from Flutter-style specialized elements to an HTML/CSS-like single element with runtime styling to shorten Rust compile feedback loops.