Conversation
8b28793 to
c8f6b19
Compare
| codegen-units = 1 | ||
| codegen-units = 1 # Allows LLVM to perform cross-module inlining and optimizations | ||
| opt-level = "z" # Optimize aggressively for binary size | ||
| lto = true # Link-Time Optimization for cross-crate dead code elimination |
| opt-level = "z" # Optimize aggressively for binary size | ||
| lto = true # Link-Time Optimization for cross-crate dead code elimination | ||
| panic = "abort" # Strips unwinding/landing pads (saves ~10-20% size; does not affect Result/JsError) | ||
| strip = true # Strip debug symbols from the binary |
| codegen-units = 1 # Allows LLVM to perform cross-module inlining and optimizations | ||
| opt-level = "z" # Optimize aggressively for binary size | ||
| lto = true # Link-Time Optimization for cross-crate dead code elimination | ||
| panic = "abort" # Strips unwinding/landing pads (saves ~10-20% size; does not affect Result/JsError) |
There was a problem hiding this comment.
This I need to check the overall impact on the rust / non wasm binding module
| [profile.release] | ||
| codegen-units = 1 | ||
| codegen-units = 1 # Allows LLVM to perform cross-module inlining and optimizations | ||
| opt-level = "z" # Optimize aggressively for binary size |
There was a problem hiding this comment.
Um no, not at the root configuration at least.
I understand size is important for wasm but this impact the rest too
In general, It would be nice to run the bench before and after to see the impact.
I've spend quite a long time optimizing for speed and it is more fragile that it looks.
|
Note that compressing the wasm with brotli -q11 yields an even bigger gain (340kB -> 110kB) without touching the optimization flags. That should probably come in first since this making no compromise on speed either (beside the added decompression of 110kB - that probably deserve a bench) If you don't mind resubmitting the release profile change that are making not making any compromise between speed and size, I'd be happy to take this for a start. When it comes, to wasm, I think having different release mode is probably the way to go, though I have no idea how web guys would handle that on things like npm ? |
|
I wonder if python test failing comes from one of the options, like the panic one maybe 🤔 ? |
from 330 to 240kB
Note:
opt-level = "z"might have a negative impact on the perf for the rust lib.Things we can do:
I can amend the PR with one or the other, let me know!