Skip to content

Instantly share code, notes, and snippets.

@mafintosh
Created October 19, 2016 13:02
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 mafintosh/c148f4b3eca87846eade85d0d876a570 to your computer and use it in GitHub Desktop.
Save mafintosh/c148f4b3eca87846eade85d0d876a570 to your computer and use it in GitHub Desktop.
var fs = require('fs')
for (var i = 0; i < 10000; i++) {
printLength(__filename)
}
function printLength (filename) {
fs.readFile(filename, foo)
function foo (err, buf) {
if (err) return // ignore error - probably just too many fds
console.error(filename + ' has length ' + buf.length)
}
}
@fhinkel
Copy link

fhinkel commented Feb 17, 2017

So, I (slightly) adapted this test for a micro benchmark. It just got a massive bump (7 times faster) on V8 master (We sped this up a while ago but behind a flag, flag is on by default now).

This should be in the V8-Node integration build in a few hours. I'll retry on the original Node example then.

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