diff --git a/plugins/examples/hello-workbench/backend/Cargo.toml b/plugins/examples/hello-workbench/backend/Cargo.toml index 3db2f7cfb6..84228513c5 100644 --- a/plugins/examples/hello-workbench/backend/Cargo.toml +++ b/plugins/examples/hello-workbench/backend/Cargo.toml @@ -9,3 +9,8 @@ license = "Apache-2.0" [dependencies] dbx-plugin-sdk = { path = "../../../sdk/rust/dbx-plugin-sdk" } serde_json = "1" + +[profile.release] +strip = true +lto = true +codegen-units = 1 diff --git a/plugins/sdk/cli/templates/rust/backend/Cargo.toml b/plugins/sdk/cli/templates/rust/backend/Cargo.toml index 301acb9846..c72ef08585 100644 --- a/plugins/sdk/cli/templates/rust/backend/Cargo.toml +++ b/plugins/sdk/cli/templates/rust/backend/Cargo.toml @@ -9,3 +9,11 @@ license = "Apache-2.0" [dependencies] dbx-plugin-sdk = {{RUST_SDK_DEPENDENCY}} serde_json = "1" + +# Keep plugin binaries close to the host app's size: default release settings +# leave ~20MB of symbols and unoptimized generic code in an OpenDAL-sized backend. +# panic stays "unwind" so the sidecar protocol can report panics as errors. +[profile.release] +strip = true +lto = true +codegen-units = 1