summaryrefslogtreecommitdiff
path: root/src/mongo/db/index_builder.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2015-01-21 15:03:02 -0500
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2015-01-26 12:34:07 -0500
commitfe3e92d4257b30f01b62d4ef941686b7e0138a8c (patch)
tree00ab59aeddf0e1b6bbbf655e84d9f0b4e1dd6501 /src/mongo/db/index_builder.cpp
parent78390e4da7e48532194cba623c55d566bc09cc70 (diff)
downloadmongo-fe3e92d4257b30f01b62d4ef941686b7e0138a8c.tar.gz
SERVER-16773 Get rid of ScopedLock and 2 memory allocations
This change removes ScopedLock from the RAII lock objects' hierarchy. This eliminates two memory allocations and two acquisitions of the Parallel Batch Writer mutex. I did not see any significant performance improvement, but next change would be to remove the allocation of the PBR mutex as well and also to make WriteBatchExecutor not allocate lock objects.
Diffstat (limited to 'src/mongo/db/index_builder.cpp')
-rw-r--r--src/mongo/db/index_builder.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/mongo/db/index_builder.cpp b/src/mongo/db/index_builder.cpp
index 6a3fd677a83..199129304ec 100644
--- a/src/mongo/db/index_builder.cpp
+++ b/src/mongo/db/index_builder.cpp
@@ -82,8 +82,7 @@ namespace {
LOG(2) << "IndexBuilder building index " << _index;
OperationContextImpl txn;
-
- Lock::ParallelBatchWriterMode::iAmABatchParticipant(txn.lockState());
+ txn.lockState()->setIsBatchWriter(true);
txn.getClient()->getAuthorizationSession()->grantInternalAuthorization();