-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrated Event Profiling #41
base: master
Are you sure you want to change the base?
Conversation
Here are the benchmark results for AST interpreter
Bytecode interpreter
|
Here are the benchmark results for AST interpreter
Bytecode interpreter
|
a2e442f
to
604a8e1
Compare
Here are the benchmark results for AST interpreter
Bytecode interpreter
|
This PR integrates a profiler within the interpreter (only the bytecode interpreter for now), which records events along with their timings and allows to generate callgraphs, flamegraphs and other visualisations of the interpreter's runtime.
It makes use of the measureme crate, which is an event recorder created by the Rust compiler team and used for the
-Z self-profile
compiler flag in the nightly Rust compiler.The profiling features are gated behind a new Cargo feature flag called
profiler
for the bytecode interpreter, to avoid slowing down normal builds.A profiler-instrumented binary can be built like so:
After running the instrumented interpreter, a file called
som-trace.mm_profdata
is created in the current directory, containing all of the recorded events and their timings.A collection of separate tools (also from the Rust compiler team) can then be used to visualise this data in various ways:
Example
chrome_profiler.json
file, compatible with the Chromium performance tools.Example
perf
tools.The output file is named
rustc.svg
.Example
Unlike
measureme
, these tools are not released on crates.io, so the main way to install them is to install them directly from the git repository, like so: