Files
qbz/scripts/slint-dev-fast.sh
T
vicrodh ec4b10fcb6 chore(slint): faster dev builds — mold linker + debug fast script
Add scripts/slint-dev-fast.sh: a DEBUG (non-release) build for quick visual
iteration — opt-level 0 so the giant Slint-generated module skips the heavy
LLVM passes, plus the mold linker, no debuginfo, and the nightly parallel
frontend. It builds into target/debug, separate from the release cache.

slint-dev.sh (release, kept for perf measurement) gains the mold linker and
bumps the frontend threads 8 -> 16 — both only cut compile time, the optimised
binary is unchanged.

cc
2026-06-02 11:32:01 -06:00

27 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# QBZ Slint — FAST dev build/run (DEBUG, *not* release).
#
# ADDITION to ./slint-dev.sh, NOT a replacement. Use this for quick, purely
# visual / layout iteration where runtime performance does NOT matter — it is
# dramatically faster to compile than the release build because:
# - debug profile (opt-level 0) → the giant Slint-generated module skips the
# heavy LLVM optimisation passes that dominate the release build,
# - the `mold` linker (much faster than the default `ld`),
# - NO debuginfo (`-C debuginfo=0`) → less to generate AND less to link,
# - the nightly PARALLEL FRONTEND (`-Z threads`) across cores.
# Debug builds live in target/debug, separate from the release target/release,
# so the two scripts don't invalidate each other's cache.
#
# DO NOT use this to judge performance — the binary is unoptimised. Always do a
# final pass with ./slint-dev.sh (release) before trusting runtime behaviour.
#
# RUSTFLAGS overrides .cargo/config.toml, so the AES-NI/SSSE3 features are
# re-listed here (keep in sync with slint-dev.sh / .cargo/config.toml).
#
# Usage: ./scripts/slint-dev-fast.sh [extra cargo args]
# THREADS=22 ./scripts/slint-dev-fast.sh # override frontend threads
set -euo pipefail
cd "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.."
export RUSTFLAGS="-C target-feature=+aes,+ssse3 -C link-arg=-fuse-ld=mold -C debuginfo=0 -Z threads=${THREADS:-16}"
exec cargo +nightly run --manifest-path crates/Cargo.toml -p qbz-slint "$@"