Node.js Secrets Uncovered

MD
R
Markdown

Some cool stuff to know about Node.js Based on: https://github.com/mhevery/AngularConnect-2019

  • There are 800 options to configure on Node V8 node --v8-options node --trace-opt --trace-deopt ./dist/sample.js node --trace-ic ./dist/sample.js (will generate a log file) node --prof ./dist/sample.js

  • Deoptigate is a nice tool ./node_modules/.bin/deoptigate /dist/sample.js

  • V8Engine Compiler: -- 5% (interpret JS code, collects info about JS) -- 95% (runs assembly instructions)

  • +10K iterations, we have C++ cache misses as object shape comparison gets override

  • Guarantee High Performance: a) All the code has monomorphic property reads (works only for one type) b) Design data structures which maintain shape c) Iterate over arrays (rather than object keys) d) Store Data in Arrays for read and space efficiency.

  • TView, Node and LView

Created on 3/4/2020