0.1.0 • Published 8 years ago

instrument-v8 v0.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

instrument-v8 (WIP)

Instrument your code to see if everything is optimized.

Inspired by this article: https://github.com/petkaantonov/bluebird/wiki/Optimization-killers

Installation

npm install instrument-v8 -g

Usage

instrument-v8 <pathToModule> --methodToCall=argumentsForMethod

for example, let's take Jade:

npm install jade

Let's see if the render function is optimized:

instrument-v8 node_modules/jade --render='""'

The results is:

Function jade::render is not optimized

If you look into the source code you will see that there is a try-catch that is preventing optimizations. The solution is to move the try-catch to a separate function allowing the rest of the render function to be optimized.

See Also

v8-natives