0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +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 );