0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 00:56:44 +01:00
mongodb/speed.js

14 lines
243 B
JavaScript
Raw Normal View History

2011-07-15 20:14:08 +02:00
t = db.fooo;
t.drop();
x = { str:'aaaabbbbcc' }
s = new Date();
for( var i = 0; i < 100000; i++ ) {
x.i = i;
t.insert(x);
}
print( (new Date())-s );
t.ensureIndex({x:1});
t.ensureIndex({str:1});
print( (new Date())-s );