This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function valuesFn (array) { | |
var i = 0 | |
return function foo (abort, cb) { | |
if(i >= array.length) | |
cb(true) | |
else | |
cb(null, array[i++]) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs') | |
for (var i = 0; i < 10000; i++) { | |
printLength(__filename) | |
} | |
function printLength (filename) { | |
fs.readFile(filename, foo) | |
function foo (err, buf) { |