Skip to content

Conversation

@ladvoc
Copy link
Contributor

@ladvoc ladvoc commented Jan 14, 2026

Applies the following optimizations to the release profile with the goal of reducing FFI dylib size:

[profile.release]
opt-level = "z"
lto = true
codegen-units = 1
panic = "abort"
strip = "symbols"
debug = false

Reference: Profiles, The Cargo Book

Initial results:

  • For a local release build on macOS, dylib size shrinks from 33.8MB to 28.1MB.
  • Have not evaluated impact on performance yet. Most likely improves, but in some cases enabling optimizations can hurt.

Before merging, we should verify this does not introduce regressions (especially during linking with the C++ SDK).

Copy link
Contributor

@cloudwebrtc cloudwebrtc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@xianshijing-lk xianshijing-lk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love it, thanks

@ladvoc ladvoc merged commit 2975ff4 into main Jan 16, 2026
10 checks passed
@ladvoc ladvoc deleted the jacobgelman/bot-187-rust-ffi-build-optimizations branch January 16, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants