About 50% slower in my synthetic scenario. The only difference is that (I guess) 2.4 relies on writeOps + GLE while 2.6 uses writeCmd (and so, in my test I didn't call GLE after remove() call).
2.6 testcase:
db.dropDatabase(); var ndocs = 20000; for (var i = 0; i < ndocs; ++i) { db.foo.insert({"a": i}); } db.foo.ensureIndex({"a": 1}); var before = new Date().getTime(); for (var i = 0; i < ndocs; ++i) { db.foo.remove({"a": i}); } print(new Date().getTime() - before);
2.6 results (githash ad91eb0f75f39c1bb71b5e0ca4279b883cb9fe8d ):
$ for i in `seq 1 5`; do ./mongo remove-26.js |grep ^[0-9]; done 4941 4937 4952 4932 4936
2.4 testcase:
db.dropDatabase(); var ndocs = 20000; for (var i = 0; i < ndocs; ++i) { db.foo.insert({"a": i}); } db.foo.ensureIndex({"a": 1}); var before = new Date().getTime(); for (var i = 0; i < ndocs; ++i) { db.foo.remove({"a": i}); db.getLastError(); } print(new Date().getTime() - before);
2.4 results:
$ for i in `seq 1 5`; do ./mongo remove-24.js |grep ^[0-9]; done 2782 2741 2737 2751 2755