load-perf
Idea
Main idea here is to measure the load(require) time for dependencies and devDependencies for your project or module. we also calculate the load(require) time of your module. This give an idea about how much time would it take for your module to be required by the consumer.
Key points:
- Measure load performance of your module when its required
- Measure load performance of your dependencies
- Measure load performance of your devDependencies
How to use
Just install the module
npm install load-perf -g
Then just run the module on your project or module
load-perf
Options
-h, --help Show help. -v, --version Outputs the version number. -p, --package path::String Package json file path. - default: ./package.json -d, --checkDevDependencies Perf calculation
NodeJs API
You can consume this module programmatically through the Node.js API also.
var loadPerf = ; var defaultOptions = package: "./package.json" checkDevDependencies: false checkDependencies: true; var performanceData = ;
Even if the options are not supplied to the function, we will use the defaults.
Output Example
All times are in ms
.
$ load-perfDependencies:chalk : 21.332987concat-stream : 16.36361debug : 13.844468doctrine : 10.851406escape-string-regexp : 1.946993escope : 67.604855espree : 17.298621estraverse : 3.452687estraverse-fb : 8.504899glob : 18.858194globals : 3.553849handlebars : 62.334192inquirer : 101.852429file-entry-cache : 1.86819is-my-json-valid : 9.402158is-resolvable : 2.927087js-yaml : 47.601996lodash.clonedeep : 20.422166lodash.merge : 25.618057lodash.omit : 23.293907minimatch : 6.914903mkdirp : 1.686758object-assign : 1.593661optionator : 27.581543path-is-absolute : 1.661102path-is-inside : 1.762264shelljs : 37.127746strip-json-comments : 1.587796text-table : 1.437153to-double-quotes : 1.988777to-single-quotes : 1.725977user-home : 1.437153xml-escape : 1.249491 Module load time: 278.161939