Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

$ node --trace-inlining context-allocated-vars.js 

@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