I'm measuring the performance difference of insert between a connection with safe: true and another with safe: false. However, changing the safe variable does not seem to affect the performance at all.
var dbURI = 'mongodb://' + 'user' + ':' + 'password' + '@' + '11.111.111.111' + ':' + '3000' + '/' + 'test';
var db = mongo.db(dbURI, {safe: true/false});
var queryArray = [];
for (var i = 0; i < 200000; i++) {
queryArray.push({random: i})
}
db.collection('insertTest1').insert(queryArray, function(err, result) {
respond ('it is done');
});
Even when I switch the safe variable around, the average execution time always comes out to be around 25 seconds. I was under the impression setting the safe variable to false would drastically improve performance.
Is this not how you change the safe variable in mongoskin? Or is this an expected result?