From 5c75c3988311d31c06c00ef9f9ee6eee1c882594 Mon Sep 17 00:00:00 2001 From: Jon Seager Date: Fri, 6 Feb 2026 18:05:16 +0000 Subject: [PATCH] perf(build): add release profile, lld linker, and defer script tags - Add [profile.release] with thin LTO and symbol stripping - Configure lld linker via .cargo/config.toml for faster linking - Add clang and lld to Nix devShell - Add defer attribute to component script tags to unblock HTML parsing --- .cargo/config.toml | 5 +++++ Cargo.toml | 4 ++++ flake.nix | 2 ++ templates/base.html | 4 ++-- 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..f973e9d --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,5 @@ +[target.x86_64-unknown-linux-gnu] +rustflags = ["-C", "link-arg=-fuse-ld=lld"] + +[target.aarch64-unknown-linux-gnu] +rustflags = ["-C", "link-arg=-fuse-ld=lld"] diff --git a/Cargo.toml b/Cargo.toml index 18150f2..5a309ec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,6 +54,10 @@ name = "cli" path = "tests/cli/main.rs" harness = true +[profile.release] +lto = "thin" +strip = true + [profile.test] # Run CLI tests serially to share single server instance opt-level = 0 diff --git a/flake.nix b/flake.nix index 660832c..185f9af 100644 --- a/flake.nix +++ b/flake.nix @@ -111,7 +111,9 @@ ] ++ (with pkgs; [ cargo-watch + clang flyctl + lld nil nixfmt openssl diff --git a/templates/base.html b/templates/base.html index 5aa47b3..68548bd 100644 --- a/templates/base.html +++ b/templates/base.html @@ -20,8 +20,8 @@ type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.0-RC.6/bundles/datastar.js" > - - + + {% block head %}{% endblock %}