You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the Wasmi executor treats host function calls different to any other Wasmi bytecode instruction execution. The reason for that is simple: In order to invoke host functions the executor needs to know about the generic host state type T of the Store<T>.
One design principle of the current Wasmi executor is to make it non-generic and thus we introduced the non-generic StoreInner and made the Wasmi executor work on it instead of Store<T>. The obvious downside is that we need special treatment for host function calls which is ugly. Also it necessitates returning a large struct from the Wasmi executor which is not perfect for the optimizer to handle well and might be the performance issue we see on some platforms.
As an aside this refactoring will also greatly help if we are ever going to use tail call dispatch for the Wasmi executor once explicit tail calls become a thing in Rust.
The text was updated successfully, but these errors were encountered:
I performed some local benchmarks with an experimental branch that simply removes host function calls and all their related handlers in the Wasmi executor to emulate what would happen if we were to implement this PR naively. The benchmarks showed no significant change indicating that either the experiment is flawed or that the optimizer can do a good enough job to reduce both cases to roughly the same assembly via aggressive inlining etc.
Currently the Wasmi executor treats host function calls different to any other Wasmi bytecode instruction execution. The reason for that is simple: In order to invoke host functions the executor needs to know about the generic host state type
T
of theStore<T>
.One design principle of the current Wasmi executor is to make it non-generic and thus we introduced the non-generic
StoreInner
and made the Wasmi executor work on it instead ofStore<T>
. The obvious downside is that we need special treatment for host function calls which is ugly. Also it necessitates returning a largestruct
from the Wasmi executor which is not perfect for the optimizer to handle well and might be the performance issue we see on some platforms.As an aside this refactoring will also greatly help if we are ever going to use tail call dispatch for the Wasmi executor once explicit tail calls become a thing in Rust.
The text was updated successfully, but these errors were encountered: