wasmi icon indicating copy to clipboard operation
wasmi copied to clipboard

Profiling support

Open axic opened this issue 6 years ago • 2 comments

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.

axic avatar Jul 16 '19 16:07 axic

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?

axic avatar Aug 17 '19 21:08 axic

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.

pepyakin avatar Aug 19 '19 14:08 pepyakin

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.

Robbepop avatar Aug 22 '22 18:08 Robbepop