Skip to content

Instantly share code, notes, and snippets.

@Kirill89
Last active July 10, 2018 06:42
Show Gist options
  • Save Kirill89/bcac20a84a96ee654c7ae41fc5cc0147 to your computer and use it in GitHub Desktop.
Save Kirill89/bcac20a84a96ee654c7ae41fc5cc0147 to your computer and use it in GitHub Desktop.
node flamegraph on mac

Install

Use

Cleanup old map files:

sudo rm /tmp/perf-*

Run your script to profile:

sudo profile_1ms.d -c 'node --perf-basic-prof <script_name>.js' > dtrace.txt

Make flame graph:

cat dtrace.txt | node --max-old-space-size=8192 "$(which flamegraph)" --map /tmp/perf-<pid>.map --inputtype dtrace > flamegraph.svg

--max-old-space-size=8192 for large dtrace files.

node --prof <script_name>
node --prof-process isolate-0xnnnnnnnnnnnn-v8.log > processed.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment