Can adjust the length of the benchmarks

pull/2/head
Louis Chatriot 12 years ago
parent 52af6d2330
commit 85e7faeec6
  1. 6
      benchmarks/insert.js

@ -8,7 +8,7 @@ var Datastore = require('../lib/datastore')
, d , d
; ;
if (process.argv[2]) { console.log(process.argv);} if (process.argv[2]) { n = parseInt(process.argv[2], 10); }
console.log("Benchmarking insert"); console.log("Benchmarking insert");
@ -32,9 +32,9 @@ async.waterfall([
var beg = new Date() var beg = new Date()
, i = 0; , i = 0;
console.log("Inserting 10,000 documents"); console.log("Inserting " + n + " documents");
async.whilst( function () { return i < 10000; } async.whilst( function () { return i < n; }
, function (_cb) { , function (_cb) {
i += 1; i += 1;
d.insert({ docNumber: i }, function (err) { d.insert({ docNumber: i }, function (err) {

Loading…
Cancel
Save