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
This commit is contained in:
Jon Seager 2026-02-06 18:05:16 +00:00
parent 4fb2e945a4
commit 5c75c39883
No known key found for this signature in database
4 changed files with 13 additions and 2 deletions

5
.cargo/config.toml Normal file
View file

@ -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"]

View file

@ -54,6 +54,10 @@ name = "cli"
path = "tests/cli/main.rs" path = "tests/cli/main.rs"
harness = true harness = true
[profile.release]
lto = "thin"
strip = true
[profile.test] [profile.test]
# Run CLI tests serially to share single server instance # Run CLI tests serially to share single server instance
opt-level = 0 opt-level = 0

View file

@ -111,7 +111,9 @@
] ]
++ (with pkgs; [ ++ (with pkgs; [
cargo-watch cargo-watch
clang
flyctl flyctl
lld
nil nil
nixfmt nixfmt
openssl openssl

View file

@ -20,8 +20,8 @@
type="module" type="module"
src="https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.0-RC.6/bundles/datastar.js" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.0-RC.6/bundles/datastar.js"
></script> ></script>
<script src="/components/photo-capture.js"></script> <script defer src="/components/photo-capture.js"></script>
<script src="/components/searchable-select.js"></script> <script defer src="/components/searchable-select.js"></script>
{% block head %}{% endblock %} {% block head %}{% endblock %}
<script> <script>
document.addEventListener("DOMContentLoaded", () => { document.addEventListener("DOMContentLoaded", () => {