Skip to content

Instantly share code, notes, and snippets.

@Mistobaan
Created June 22, 2013 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mistobaan/5835397 to your computer and use it in GitHub Desktop.
Save Mistobaan/5835397 to your computer and use it in GitHub Desktop.

Avi Flax wrote a very interesting article about Profiling Node Programs on Mac OS X. However, if you manage your Node.js installation with homebrew, you can use the following scripts to install the V8 debugger separately.

Just download this Gist, make install.sh executable with chmod u+x install.sh and run the script.

#!/bin/sh
export D8_PATH=/usr/local/bin
coffee --nodejs --prof $@
echo "\rProcessing v8.log ..."
/usr/local/bin/tools/mac-tick-processor >> v8-processed.log
git clone https://github.com/v8/v8.git
if [ ! -d "v8" ]; then
echo "Error: Could not clone V8"
exit 1
fi
cd v8
scons d8
if [ ! -f "d8" ]; then
echo "Error: Compiled 'd8' not found."
exit 1
fi
cp -R d8 tools /usr/local/bin
echo "You can remove the cloned v8 repo now."
chmod u+x node-profile coffee-profile
cp node-profile coffee-profile /usr/local/bin
exit 0
#!/bin/sh
export D8_PATH=/usr/local/bin
node --prof $@
echo "\rProcessing v8.log ..."
/usr/local/bin/tools/mac-tick-processor >> v8-processed.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment