Skip to content

Instantly share code, notes, and snippets.

@davidmarkclements
Created October 19, 2016 17:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save davidmarkclements/1506a061ddf4fde88d11ab454faaae5a to your computer and use it in GitHub Desktop.
Save davidmarkclements/1506a061ddf4fde88d11ab454faaae5a to your computer and use it in GitHub Desktop.
const bench = require('fastbench')
function valuesFn (array) {
var i = 0
return function (abort, cb) {
if(i >= array.length)
cb(true)
else
cb(null, array[i++])
}
}
const run = bench([
function benchValues (done) {
valuesFn([], function() {})
setImmediate(done)
}
], 100000)
run()
@davidmarkclements
Copy link
Author

other things:

what about objects?
what about functions?
what about function-objects?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment