0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-29 16:47:28 +01:00
mongodb/speed.js
2011-08-02 02:36:36 -04:00

14 lines
243 B
JavaScript
Executable File

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 );