Created
September 6, 2013 23:22
-
-
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.
This file contains hidden or 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 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