with nodejs v8, there is some new fun stuff for finding deopts, alongside existing ways to view them easily in chrome.
- clone chromium deopt_tools
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
(optionally export the $PATH) - download chromium, put in Applications
- run chromium with some flags
/Applications/Chromium.app/Contents/MacOS/Chromium --remote-debugging-port=9222 --js-flags="--trace-opt --trace-deopt"
- use nvm to install nodejs v8 (
nvm install 8.1 && nvm alias default 8.1 && nvm use 8.1
) - run
node prof YOUR_FILE_HERE
, thennode --prof-process isolate-TAB_AUTO_COMPLETE_HERE
- run using chrome devtools
node --inspect --debug-brk YOUR_FILE_HERE
- https://twitter.com/bmeurer/status/870647864329981952 (this has everything you need, thanks @trueadm)
- https://www.chromium.org/developers/how-tos/run-chromium-with-flags
- https://gist.github.com/kevincennis/0cd2138c78a07412ef21
- http://peter.sh/experiments/chromium-command-line-switches/
- https://v8project.blogspot.ca/2017/05/launching-ignition-and-turbofan.html
- https://v8project.blogspot.ca/2016/08/firing-up-ignition-interpreter.html
- https://hackernoon.com/debug-node-js-with-chrome-devtools-aca7cf83af6b
- https://medium.com/@paul_irish/debugging-node-js-nightlies-with-chrome-devtools-7c4a1b95ae27
- https://insight.io/github.com/nodejs/node/blob/master/deps/v8/src/crankshaft/hydrogen-check-elimination.cc
- http://benediktmeurer.de/2017/03/01/v8-behind-the-scenes-february-edition/
- https://github.com/vhf/v8-bailout-reasons
- https://news.ycombinator.com/item?id=14373885
- https://github.com/petkaantonov/bluebird/wiki/Optimization-killers
- https://developers.google.com/v8/profiler_example
- http://www.mattzeunert.com/2015/08/19/viewing-assembly-code-generated-by-v8.html
- https://github.com/nodejs/diagnostics/tree/master/tracing/AsyncWrap
- http://mrale.ph/irhydra/2/
- https://github.com/thlorenz/v8-perf/blob/master/performance-profiling.md
- https://blog.ghaiklor.com/tracing-de-optimizations-in-nodejs-2ba16900fc6f
- https://stackoverflow.com/questions/21357963/nodejs-profiling-what-to-do-with-v8-log-file
- http://www.mattzeunert.com/2015/08/19/viewing-assembly-code-generated-by-v8.html
- https://kripken.github.io/emscripten-site/docs/optimizing/Optimizing-Code.html
- https://community.risingstack.com/how-to-find-node-js-performance-optimization-killers/
- https://github.com/v8/v8/blob/master/tools/profview/index.html
- https://nodejs.org/api/tracing.html
- https://github.com/fluents/bench-chain
- http://perf.rocks/tools/
- https://github.com/sidorares/node-tick
- https://github.com/node-inspector/node-inspector
- https://github.com/RisingStack/trace-nodejs
- https://nodejs.org/api/cli.html
- https://github.com/nodejs/node/tree/master/benchmark
- https://stackoverflow.com/questions/38598175/v8-doesnt-optimize-function-after-manually-doing-typed-array-sets
- https://github.com/bnoordhuis/v8-git-mirror/blob/master/src/deoptimizer.h
- http://mrale.ph/blog/2011/12/18/v8-optimization-checklist.html
- https://www.youtube.com/watch?v=UJPdhx5zTaw
- https://v8.paulfryzel.com/docs/master/deoptimize-reason_8h_source.html