From 16a5957aa7fa9a3201e2d22f1ed1c88e60e416a8 Mon Sep 17 00:00:00 2001 From: Duncan Tourolle Date: Sun, 4 Oct 2026 10:45:43 -0400 Subject: [PATCH] Compile dr-ui on sixteen codegen units in release builds Slint expands the .slint files into ~27 MB of Rust, and at the workspace's single codegen unit LLVM optimised all of it on one thread: 13.5 minutes of a release build with the other cores idle. The override applies to dr-ui alone; the image crates keep one unit, and thin LTO still runs at link time. --- Cargo.toml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 75e459f..bd43e3e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -278,6 +278,14 @@ opt-level = 0 lto = "thin" codegen-units = 1 +# Except dr-ui. Slint expands the `.slint` files into ~27 MB of Rust +# (`out/app.rs`), and at one codegen unit LLVM optimises all of it on a single +# thread: 13.5 minutes of a release build with the other cores idle. The code +# it holds is UI glue — property bindings and callbacks — not the image work, +# which lives in the crates above that keep the single unit. +[profile.release.package.dr-ui] +codegen-units = 16 + # A release build that can say where it panicked: line tables, so a crash # record's backtrace (`dr_plat::crash`) reads `file.rs:123` rather than bare # addresses. The macOS build uses it (docs/dev/macos.md) — no one here can