Created
March 7, 2014 16:24
-
-
Save joliss/9414639 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env node | |
var fs = require('fs') | |
var rimraf = require('rimraf') | |
fs.mkdirSync('x') | |
var string = '' | |
for (var i = 0; i < 100; i++) { | |
string += '1234567890' | |
} | |
var buf = new Buffer(string) | |
console.time('write') | |
for (i = 0; i < 10000; i++) { | |
fs.writeFileSync('x/' + i, buf) | |
} | |
console.timeEnd('write') | |
rimraf.sync('x') | |
// on my system: 25µs to write each 1KB file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment