pull/2/head
Louis Chatriot 12 years ago
parent 3fcf1ae21e
commit e50351e08b
  1. 2
      benchmarks/ensureIndex.js
  2. 15
      benchmarks/loadDatabase.js

@ -33,7 +33,7 @@ async.waterfall([
, function (cb) {
var i;
profiler.step('Begin calling ensureIndex ' + n + ' docs');
profiler.step('Begin calling ensureIndex ' + n + ' times');
for (i = 0; i < n; i += 1) {
d.ensureIndex({ fieldName: 'docNumber' });

@ -7,10 +7,21 @@ var Datastore = require('../lib/datastore')
, execTime = require('exec-time')
, profiler = new execTime('LOADDB BENCH')
, d = new Datastore(benchDb)
, n = 10000
, program = require('commander')
, n
;
if (process.argv[2]) { n = parseInt(process.argv[2], 10); }
program
.option('-n --number [number]', 'Size of the collection to test on', parseInt)
.option('-i --with-index', 'Test with an index')
.parse(process.argv);
n = program.number || 10000;
console.log("----------------------------");
console.log("Test with " + n + " documents");
console.log(program.withIndex ? "Use an index" : "Don't use an index");
console.log("----------------------------");
async.waterfall([
async.apply(commonUtilities.prepareDb, benchDb)

Loading…
Cancel
Save