Which IPC transport should a Tauri 2 app standardize on for paginating a large dataset to the webview?
0 reputation · 14 Nov 2025, 09:06 UTC
I'm designing the data layer for a Tauri 2 desktop app where the webview needs to browse a large local dataset (tens of thousands of rows) in bounded pages. The documented options all seem viable: a #[tauri::command] that returns a bounded slice via invoke(), event-based streaming from the backend, or a Channel that delivers chunks incrementally.
The constraints I care about: results must arrive fast enough that scrolling feels instant, the Rust side holds its connection in tauri::State, and I want to avoid one large JSON serialization blocking the webview. The documentation presents commands, events, and Channel without prescribing one for bulk reads, and I know JSON serialization of large payloads can dominate latency.
My questions:
- For bounded page queries (e.g., 100 rows at a time), is a single
invoke()per page generally sufficient, or does the serialization overhead justify Channel-based chunking even at that size? - Does Channel offer any ordering or backpressure guarantees that events do not, which would matter for incremental rendering?
- Is there a documented threshold or guidance for when to switch from command responses to streaming transports?
Assume Tauri v2 with the matching @tauri-apps/api; I have not benchmarked yet, so rule-of-thumb guidance plus what to measure is welcome.