@luc-blaeser found in some experiments that the new overhead pertaining to the cost of Call instructions can be mitigated down to ~4% with aggressive inlining options from wasm-opt. This has a large cost in terms of binary size (2.2x) but can serve as a temporary fix while we find better, Motoko specific inlining strategies.
The specific options are
-O4 -ifwl -aimfs 100
-ifwl stands for inline functions with loops
-aimfs stands for always inline max function size
The arguments to the optimize command has been restructured so adding further options in the future is easy.
This PR is related to the new cost model.
@luc-blaeser found in some experiments that the new overhead pertaining to the cost of
Call
instructions can be mitigated down to~4%
with aggressive inlining options fromwasm-opt
. This has a large cost in terms of binary size (2.2x
) but can serve as a temporary fix while we find better, Motoko specific inlining strategies.The specific options are
-ifwl
stands for inline functions with loops-aimfs
stands for always inline max function sizeThe arguments to the
optimize
command has been restructured so adding further options in the future is easy.