slint icon indicating copy to clipboard operation
slint copied to clipboard

Option to split generated Rust into multiple modules/files for faster incremental builds

Open kevingatera opened this issue 1 month ago • 1 comments

Bug Description

What: Slint’s Rust codegen emits a single, large generated file. For large UIs, even tiny .slint edits force rustc to re-parse/re-optimize the whole thing, making incremental builds slow. An opt‑in split mode would let rustc do less work per change.

Expected vs. actual: Expected incremental rebuilds after small UI edits to be relatively fast; actual: they recompile a massive monolithic generated module.

Reproducible Code (if applicable)

Any large .slint file that generates a big main_window.rs (e.g., https://gitlab.com/kevingatera/asusctl) will show the slowdown;

You can use cargo build -p rog-control-center

Environment Details

  • Slint Version: 1.15
  • Platform/OS: Linux (Wayland) - but issue is general
  • Programming Language: Rust

Product Impact

Building desktop GUI apps; slow incremental builds are a productivity hit

kevingatera avatar Dec 04 '25 23:12 kevingatera

The compilation time is indeed a problem.

One "solution" in development for faster incremental build, is to use the live preview feature: https://docs.rs/slint/latest/slint/docs/cargo_features/index.html#:~:text=live-preview SLINT_LIVE_PREVIEW=1 cargo run --features slint/live-preview

Other than that, i don't know if splitting in different file would really help: the rust incremental compilation works on a function granularity, and also small changes in .slint file would probably regenerate all files.

ogoffart avatar Dec 05 '25 10:12 ogoffart