Skip to content

Commit bfeba91

Browse files
kdy1lucasadrianof
authored andcommitted
chore: Add opt-level = s for not frequently used crates (vercel#85426)
### What? Combined with `codegen-units = 1` (I'll send another PR for this), these two patches reduce the binary size by 4MB (36MB -> 32MB) Before: swc-project/swc#11188 (comment) (`swc.linux-x64-gnu.node | 36M (37113184 bytes)`) After: swc-project/swc#11190 (comment) (`swc.linux-x64-gnu.node | 32M (32959328 bytes)`) ### Why? To reduce the binary size ### How?
1 parent 29386dc commit bfeba91

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Cargo.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,31 @@ opt-level = 3
248248
[profile.release.package.serde]
249249
opt-level = 3
250250

251+
[profile.release.package.wasmer]
252+
opt-level = "s"
253+
254+
[profile.release.package.wasmer-vm]
255+
opt-level = "s"
256+
257+
[profile.release.package.wasmer-compiler-cranelift]
258+
opt-level = "s"
259+
260+
[profile.release.package.regalloc2]
261+
opt-level = "s"
262+
263+
[profile.release.package.swc_plugin_backend_wasmer]
264+
opt-level = "s"
265+
266+
[profile.release.package.globset]
267+
opt-level = "s"
268+
269+
[profile.release.package.toml_edit]
270+
opt-level = "s"
271+
272+
[profile.release.package.miette]
273+
opt-level = "s"
274+
275+
251276
# Use a custom profile for CI where many tests are performance sensitive but we still want the additional validation of debug-assertions
252277
[profile.release-with-assertions]
253278
inherits = "release"

0 commit comments

Comments
 (0)