From 28d3ed998ac4857f41bfc966f3e72fa78829732d Mon Sep 17 00:00:00 2001 From: xfy Date: Tue, 9 Jun 2026 10:30:36 +0800 Subject: [PATCH] chore: optimize release profile for fullstack and add linux static build target - Change opt-level from 'z' to 3 for better runtime performance - Use thin LTO for faster compilation with similar results - Remove panic=abort and strip=true to preserve server debuggability - Add --debug-symbols=false to dx build for smaller WASM - Add build-linux target for static musl binary --- Cargo.toml | 6 ++---- Makefile | 10 ++++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8b4d52a..522c6a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,11 +40,9 @@ tokio = { version = "1.52", features = ["rt-multi-thread", "macros", "fs", "time [profile.release] debug = false -opt-level = "z" -lto = true +opt-level = 3 +lto = "thin" codegen-units = 1 -panic = "abort" -strip = true [features] default = ["web", "server"] diff --git a/Makefile b/Makefile index 71c2932..523fa5a 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,16 @@ -.PHONY: dev build css css-watch clean build-editor highlight-css test +.PHONY: dev build build-linux css css-watch clean build-editor highlight-css test build: @$(MAKE) build-editor @$(MAKE) highlight-css @tailwindcss -i input.css -o public/style.css --minify - @dx build --release + @dx build --release --debug-symbols=false + +build-linux: + @$(MAKE) build-editor + @$(MAKE) highlight-css + @tailwindcss -i input.css -o public/style.css --minify + @dx build --release --debug-symbols=false --target x86_64-unknown-linux-musl highlight-css: @cargo run --bin generate_highlight_css