From b8edb5c43604f480533c2d2e1655c39f706d922e Mon Sep 17 00:00:00 2001 From: Dave Hrycyszyn Date: Fri, 17 Apr 2020 18:21:22 +0100 Subject: [PATCH] Optimising wasm build size, shaves about 10% size off our wasm output. (#186) --- Cargo.toml | 1 + nym-sphinx-wasm/Cargo.toml | 12 ------------ 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8f1aa2aecb..f9cc5f358e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,6 @@ [profile.release] panic = "abort" +opt-level = "s" [workspace] diff --git a/nym-sphinx-wasm/Cargo.toml b/nym-sphinx-wasm/Cargo.toml index 68236fee96..fe1f4434b7 100644 --- a/nym-sphinx-wasm/Cargo.toml +++ b/nym-sphinx-wasm/Cargo.toml @@ -38,15 +38,3 @@ wee_alloc = { version = "0.4.2", optional = true } [dev-dependencies] wasm-bindgen-test = "0.2" - -# This gets ignored right now, and there is a compiler warning generated: -# "warning: profiles for the non root package will be ignored, specify profiles -# at the workspace root" -# -# I'm OK with that for the moment, I don't want to put it in the root Cargo file -# as I'm unclear what effect it'll have and I'm still experimenting with wasm. -# But it's good that we are reminded to do something about it before any -# production release. -[profile.release] -# Tell `rustc` to optimize for small code size. -opt-level = "s"