Skip to content

Instantly share code, notes, and snippets.

@joliss
Created March 7, 2014 16:24
Show Gist options
  • Save joliss/9414639 to your computer and use it in GitHub Desktop.
Save joliss/9414639 to your computer and use it in GitHub Desktop.
#!/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