From 50217499751add5d4aee3e730d16e63f8ff61e06 Mon Sep 17 00:00:00 2001 From: Cobb Date: Wed, 29 Jul 2026 08:25:47 -0700 Subject: [PATCH] speed(wrapper): opt-level=2 for the JS-interpreter crates (S5) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit opt-level=2 (over the profile's size-first 'z') for rquickjs-sys, regex-automata and serde_json — the QuickJS C interpreter + regex DFA + JSON parse hot paths; bounded APK-size cost to those crates. Also carries the strawcore visionOS-OFF outage fix into the build via the CI strawcore clone (restores muxed playback). --- rust/Cargo.toml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/rust/Cargo.toml b/rust/Cargo.toml index a35ae1124..b7f4aaa95 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -31,6 +31,21 @@ codegen-units = 1 panic = "unwind" opt-level = "z" +# Per-package opt-level overrides (Straw speed audit, S5). The whole tree stays +# size-optimized ("z"), but the JS-interpreter + parsing hot paths run measurably +# slow at "z" — QuickJS's C bytecode interpreter, the regex DFA engine, and JSON +# deserialization are all tight inner loops where "z" trades real runtime for a +# few KB. Bumping ONLY these three to opt-level = 2 bounds the APK-size cost to +# these crates while restoring interpreter/parse throughput. Crate names verified +# present in Cargo.lock: rquickjs-sys (QuickJS C interpreter, compiled via cc), +# regex-automata (regex execution engine, pulled by `regex`), serde_json. +[profile.release.package.rquickjs-sys] +opt-level = 2 +[profile.release.package.regex-automata] +opt-level = 2 +[profile.release.package.serde_json] +opt-level = 2 + # `url` crate for video-id extraction in stream.rs. [workspace.dependencies] url = "2"