Flame graphs are a visualization of profiled software, allowing the most frequent code-paths to be identified quickly and accurately — Brendan Gregg on flame graph
Using node --perf-basic-prof
with Xcode Instruments (on Mac) should help to generate a flame graph for performance analysis. Following this guide, it's rather easy:
- made node.js 0.12 generate a
perf-<pid>.map
usingnode --perf-basic-prof app.js
- record a stack using Xcode instruments time profiler (exported as
profile.csv
) - generate a flame graph with Brendan Gregg perl tools, using
./stackcollapse-instruments.pl profile.csv | ./flamegraph.pl > graph.svg
Sadly, the generated flame graph does not benefit from the perf-<pid>.map
thus leaving method adresses instead of their name (1cfc9a09b880
instead of LazyCompile:~ /node_modules/benchmark/benchmark.js:1870
).
Is there any way to give the mappings / symbols to Xcode instruments, to made it generate a csv file with method names (this doesn't work)?