Skip to content

Instantly share code, notes, and snippets.

@spollack
Created September 6, 2013 23:22
Show Gist options
  • Save spollack/6471301 to your computer and use it in GitHub Desktop.
Save spollack/6471301 to your computer and use it in GitHub Desktop.
A script that demonstrates a performance dropoff in streamline between versions 0.6.0 and 0.8.0.
var zlib = require('zlib');
test(_);
function test(_) {
var startTime = new Date();
var items = [];
for (var i = 0; i < 10000; i++) {
items[i] = {
value: i
};
}
items.forEach_(_, 25, function(_, item) {
doWork(item, _);
});
var endTime = new Date();
var elapsedTime = endTime.getTime() - startTime.getTime();
console.log('elapsed time: ' + elapsedTime + 'ms');
}
function doWork(item, _) {
var results = zlib.gzip(item.toString(), _);
return results;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment