perf: add release profile to reduce binary size (#328)

* perf: add release profile to reduce binary size

Add workspace-level release profile with size optimizations:
- opt-level = "z" (optimize for size)
- lto = true (cross-crate link-time optimization)
- codegen-units = 1 (better whole-program optimization)
- strip = "debuginfo" (remove debug info, preserve C API symbols)

Reduces .text section by ~32% (1.9 MiB → 1.3 MiB). The .a file
grows due to LTO bitcode embedding, but the final linked binary
(libflutter.so) will be smaller when the engine consumes it.

* chore: add codegen and debuginfo to spell check dictionary
This commit is contained in:
Eric Seidel
2026-04-02 13:29:34 -07:00
committed by GitHub
parent 0af491b628
commit 07fa11c9d9
2 changed files with 8 additions and 0 deletions
+6
View File
@@ -1,3 +1,9 @@
[workspace]
members = ["library", "patch"]
resolver = "2"
[profile.release]
opt-level = "z"
lto = true
codegen-units = 1
strip = "debuginfo"
+2
View File
@@ -28,10 +28,12 @@ words:
- cdylib
- classpath
- clippy
- codegen
- comde
- compatch
- Condvar
- datadir
- debuginfo
- declspec
- Decompressor
- dllexport