-
-
Save fhinkel/42bebdaa56bc7fca537aae8c5518c245 to your computer and use it in GitHub Desktop.
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 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) | |
| } | |
| } | |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
foois marked for optimization, but never optimized.