gpui-kit-grid

gpui-kit-grid

Live data grid for GPUI

Description

Quote boards and trading desks need a table with hundreds of thousands of rows taking thousands of updates a second. Typical grid components build an element per cell, and after a re-sort the selection lands on a different row. gpui-kit-grid is a live data grid for GPUI, the GPU UI framework behind the Zed editor, and paints every visible cell from one custom element. In the author's macOS benchmark, 1500 visible cells under 2k updates a second take about 1.1 ms per frame, against 12-14 ms for gpui-kit's built-in DataTable.

It is a separate crate on top of gpui-kit, with ideas taken from the LiveGrid grid for WinForms. Rows are addressed by key and written from any thread; a background ingest collapses updates and publishes snapshots, and sorting and filtering run in the background too. The examples compile to WebAssembly and draw with WebGPU, so you can try them in the browser from the docs site. The project notes the API will still change.

Features



Writes from any thread: GridWriter writes rows by key from anywhere, updates are collapsed by key in the background, and the UI thread only paints.

Keyed rows: rows and selection are tracked by key rather than index, so they survive re-sorting and removal.

Change highlight: changed cells flash green or red with direction arrows, and removed rows fade out.

Grouping and totals: grouping, aggregates, totals and trees, all computed in the background, such as live totals per sector.

Editing and export: edit cells while data keeps updating, copy as TSV, CSV or custom formats in the background, drag and drop, and elements inside cells.