This issue is meant to track the implementation progress of an experimental profiler for Javy.
High-level goals
- Allow developers to understand the behavior of JS programs running on Wasm.
- Output traces and an estimated instruction cost per JS opcode, per JS program
- Allow Javy developers to understand the behavior of JS programs running on Wasm to derive future optimizations.
This work is the materialization of the research work done in collaboration with the Carnegie Mellon WebAssembly Research Center around execution and optimization of dynamic languages on Wasm.
Work to be done
Using the profiler from the CLI
First, build the WebAssemlby, optionally providing a plugin:
javy build index.js -o index.wasm
Next, use the profile inject subcommand:
javy profile inject index.wasm -o index.injected.wasm
Next, run the injected Wasm through Wasmtime or your custom
embedding and retrieve the profile results.
Finally, run the analysis command to retrieve the results:
javy profile analyze index.analysis.bin
Optionally we can have a single flow that injects and performs the
analysis in a single step when the default plugin is used.
javy profile run index.js
This issue is meant to track the implementation progress of an experimental profiler for Javy.
High-level goals
This work is the materialization of the research work done in collaboration with the Carnegie Mellon WebAssembly Research Center around execution and optimization of dynamic languages on Wasm.
Work to be done
javy-profilercrate, which will be called from CLIjavy-profiler-libcrate, containing the necessary heuristics to perform bytecode rewriting and instrumentation. This crate will be compiled towasm32-wasip1and will be used by whamm as a user-defined library.Using the profiler from the CLI
First, build the WebAssemlby, optionally providing a plugin:
Next, use the
profile injectsubcommand:Next, run the injected Wasm through Wasmtime or your custom
embedding and retrieve the profile results.
Finally, run the analysis command to retrieve the results:
Optionally we can have a single flow that injects and performs the
analysis in a single step when the default plugin is used.