perf: set panic=abort and drop backtrace features (#342)
Reduces binary size of the updater staticlib when linked into the Flutter engine. On host macOS arm64 the dylib shrinks from 3.07 MB to 2.56 MB; the biggest iOS savings come from dropping the DWARF unwind tables (__eh_frame, __gcc_except_tab, __unwind_info) that panic=unwind generates. - panic = "abort" in [profile.release]: kills unwind-table generation and eliminates dead panic-unwinding code paths. We don't use catch_unwind anywhere in the library. log-panics still runs its panic hook before abort, so panic messages continue to surface to logcat/oslog during development. - Drop `backtrace` feature from anyhow and `with-backtrace` from log-panics: removes gimli + addr2line + rustc_demangle (~65 KB of symbolication machinery) that customers can't read anyway. A future in-engine crash reporter will symbolize native stacks, making these features redundant.
This commit is contained in:
+3
-3
@@ -13,7 +13,7 @@ crate-type = ["lib", "cdylib", "staticlib"]
|
||||
|
||||
[dependencies]
|
||||
# Used for error handling for now.
|
||||
anyhow = { version = "1.0.69", features = ["backtrace"] }
|
||||
anyhow = "1.0.69"
|
||||
base64 = "0.22.0"
|
||||
# For inflating compressed patch files.
|
||||
bipatch = "1.0.0"
|
||||
@@ -50,11 +50,11 @@ zip = { version = "8.5.1", default-features = false, features = ["deflate"] }
|
||||
# For logging to Android logcat.
|
||||
android_logger = "0.15.0"
|
||||
# Send panics to log (instead of stderr), thus logcat on Android.
|
||||
log-panics = { version = "2", features = ["with-backtrace"] }
|
||||
log-panics = "2"
|
||||
|
||||
[target.'cfg(any(target_os = "ios", target_os = "macos"))'.dependencies]
|
||||
# Send panics to syslog (instead of stderr).
|
||||
log-panics = { version = "2", features = ["with-backtrace"] }
|
||||
log-panics = "2"
|
||||
# Support for logging on iOS (https://developer.apple.com/documentation/oslog)
|
||||
oslog = "0.2.0"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user