From c55413c47f3c13c5f23c150d26c8852a2d6d0bfd Mon Sep 17 00:00:00 2001 From: Jet Date: Thu, 26 Mar 2026 18:36:51 -0700 Subject: [PATCH] feat: configure performance for the rust porttion --- api/Cargo.toml | 11 +++++++++++ cgol/.cargo/config.toml | 3 --- cgol/Cargo.toml | 5 ++--- flake.nix | 2 +- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/api/Cargo.toml b/api/Cargo.toml index 81164db..8e27c1c 100644 --- a/api/Cargo.toml +++ b/api/Cargo.toml @@ -13,3 +13,14 @@ serde = { version = "1", features = ["derive"] } serde_json = "1" tokio = { version = "1", features = ["full"] } tower-http = { version = "0.6", features = ["cors"] } + +[profile.dev] +debug = "line-tables-only" +split-debuginfo = "unpacked" + +[profile.release] +codegen-units = 1 +debug = 0 +lto = "thin" +panic = "abort" +strip = "symbols" diff --git a/cgol/.cargo/config.toml b/cgol/.cargo/config.toml index df3f713..39c6f19 100644 --- a/cgol/.cargo/config.toml +++ b/cgol/.cargo/config.toml @@ -3,6 +3,3 @@ target = "wasm32-unknown-unknown" [target.wasm32-unknown-unknown] rustflags = ["-C", "link-arg=--strip-all"] - -[unstable] -build-std = ["core", "alloc", "std", "panic_abort"] diff --git a/cgol/Cargo.toml b/cgol/Cargo.toml index 870a5d0..71116a6 100644 --- a/cgol/Cargo.toml +++ b/cgol/Cargo.toml @@ -1,5 +1,3 @@ -cargo-features = ["panic-immediate-abort"] - [package] name = "cgol" version = "0.1.0" @@ -41,8 +39,9 @@ wasm-opt = false debug = "line-tables-only" [profile.release] +debug = 0 opt-level = 3 lto = true codegen-units = 1 -panic = "immediate-abort" +panic = "abort" strip = true diff --git a/flake.nix b/flake.nix index 2dff2f3..90e7162 100644 --- a/flake.nix +++ b/flake.nix @@ -99,7 +99,7 @@ pname = "jetpham-qa-api"; version = "0.1.0"; src = ./api; - cargoHash = "sha256-PL5D3NtPFZcDIxf8f2EOT7fahKVgt/+7obJIdR17AUY="; + cargoHash = "sha256-mAQUSA5S3uCCo4RbWVgzMMPDjVoSTcJCFdFOx9ZaxQo="; nativeBuildInputs = [ pkgs.pkg-config ]; buildInputs = [ pkgs.openssl ]; };