Parses various fixtures and outputs parse times over various iterations
git clone git@github.com:babel/babylon_performance.git
git clone git@github.com:babel/babylon.git
npm install
npm t
Check the performance label in the babylon repo for some examples.
Microbenchmarks don't help that much, should test the real thing? (Also I don't know what I'm talking about)
- Caching,
Set.has
vs.[].indexOf(val)
, hoisting, GC issues - Make sure node shapes are the same (should be automated) babel/notes#9
Node 8 has a weird UI bug with Profiling atm, so switch to Node 6/7? https://twitter.com/drewml/status/881564816208527364
nvm use 8
node -v
It's a chrome Extension that helps automatically open the devtools when running --inspect
node --prof script.js
node --prof-process isolate*.log
# node --prof-process isolate*.log > out.txt
With babylon:
node --prof ./node_modules/babylon/bin/babylon.js fixtures/ember.debug.js
node --prof-process isolate*.log
node --trace-opt script.js | grep myFunc
node --trace-opt ./node_modules/babylon/bin/babylon.js fixtures/ember.debug.js
https://medium.com/@paul_irish/debugging-node-js-nightlies-with-chrome-devtools-7c4a1b95ae27
Point node to the babylon script and pass in a file to parse
In this case I am running node in
babylon/
withbabylon_performance/
in sibling folder
cd babylon
# node --inspect-brk script.js
node --inspect-brk ./bin/babylon.js ../babylon_performance/fixtures/angular.js
If you have install NIM, it should open up chrome and show this view: (if not you can open the url shown in the console yourself)
Then click on the "Profiler" Tab
Then click "Start"
Wait a little bit and click "Stop", and you will be redirect to this screen