Skip to content

Commit

Permalink
Add perf.js to debug very slow require time.
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberfunk committed Jan 12, 2015
1 parent e4a49d9 commit 04812e2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions perf.js
@@ -0,0 +1,9 @@
var start = process.hrtime();

var cli = require('./');

var diff = process.hrtime(start);
console.log('requires took %d microseconds',
(diff[0] * 1e9 + diff[1]) / 1000);

console.dir(Object.keys(require.cache));

0 comments on commit 04812e2

Please sign in to comment.