Skip to content

Commit

Permalink
bm
Browse files Browse the repository at this point in the history
  • Loading branch information
aheckmann committed Jun 12, 2012
1 parent 3919d38 commit 33419d4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions benchmarks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ var AllSchema = new Schema({

var A = mongoose.model('A', AllSchema);

var numdocs = 0;
var totaltime = 0;

// bench the normal way
// the try building the doc into the document prototype
// and using inheritance and bench that
Expand All @@ -54,6 +57,8 @@ function run (label, fn) {
a._delta();
}
var time = (new Date - start)/1000;
totaltime += time;
numdocs += total;
log(label + ' took %d seconds for %d docs (%d dps)', time, total, total/time);
var used = process.memoryUsage();
var res = {}
Expand Down Expand Up @@ -137,5 +142,6 @@ run('array of docs', function () {
})

//console.error(a.toObject({depopulate:true}));
console.error('completed %d docs in %d seconds (%d dps)', numdocs, totaltime,numdocs/totaltime);

// --trace-opt --trace-deopt --trace-bailout

0 comments on commit 33419d4

Please sign in to comment.