wasmi
wasmi copied to clipboard
Profiling support
It would be nice to have the ability to profile wasm execution.
I have a terrible hack in this branch (https://github.com/axic/wasmi/tree/profiling) – didn't wanted to open a PR, but I would welcome any review and comments on deciding on a design or whether such a feature is wanted / would be accepted.
Can also open a PR if that is the best way forward.
Here is an alternative approach: https://github.com/wasmx/wasm-profiler
Instead of integrating complete profiling support into VMs it encourages a very simplistic CSV output from VMs (function index + duration in nanoseconds – however want to extend this with module index too, to support multiple modules) which is then formatted nicely outside.
Any opinions?
Less invasive approach sounds better to me!
Although, I am wondering, can we get away with zero modification, i.e. by leveraging bytecode instrumentation? We could insert calls in the prologue and epilogue to a specially designated host function which would add entries in the CSV or what have you.
I am closing this since the issue is pretty dated and the linked proof of concepts were made for the legacy engine that we no longer support. If this feature is still in demand feel free to reopen this issue.