-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Enable wasm-opt optimizations in wasm-builder
#13408
Conversation
Don't merge we need to do another bench all after #13595 is merged. |
bot bench $ all |
@athei https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2539552 was started for your command Comment |
@athei Command |
bot bench $ all |
@athei https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2541022 was started for your command Comment |
@athei Command |
The last change does not seem to make a difference. Asymptotic is stable. |
Yeah if |
Neither this PR nor under the new wasmi 0.28 in #13312 we saw any performance improvements with wasm-opt. On the contrary: The performance regressed. This is why we do not enable the optimization. It should only be done if clear improvements can be demonstrated. Can be revisited later but for now there does not seem to be a reason to enable it. Maybe we can enable some selective passes that deal with code size if we want to. Or we may look into it again once we are ready to use more wasm features (post MVP). |
A while back we made the switch from the abandoned
wasm-gc
towasm-opt
. However, we didn't enable any optimizations in order to make it a in-place replacement at first.The plan was always to use those optimizations as we have seen big gains especially when running wasmi under wasmtime. The reason why this is the case is that LLVM as a register machine has a hard time optimizing wasm code. Hence this postprocessing step can be quite powerful.
A burn in with those optimization enabled has already been performed by @koute. What is left is running all benchmarks to make sure we are not producing a performance regression.
For release builds we are using
O1
which just adds 3 seconds to the build. For production builds we use the slowest profileO4
which adds 6 minutes on my machine. The production profile is already pretty slow and only used for benchmarking and releases. No developer should be using this profile locally in their workflow.@alvicsam How can a produce a new baseline in this PR using the old bare metal machines?
cc @Robbepop
Weight Compare