diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-10-15 19:52:07 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-10-15 21:57:37 -0400 |
commit | 56947bfb0ef94a523c636833a6f76dc3c6880821 (patch) | |
tree | cf5ff9222bf4f70cf1eebcaf68e7aa4a18dd566b /src/mongo/db/concurrency/lock_state_test.cpp | |
parent | 58ba874afce49711be39f19352f9b6c35bb33de6 (diff) | |
download | mongo-56947bfb0ef94a523c636833a6f76dc3c6880821.tar.gz |
SERVER-14425 Avoid memory allocations in LockerImpl
Memory allocations on the common locking path in LockerImpl increase the
cost of uncontended lock operations and are fairly easy to be avoided through
keeping a stack of already allocated memory.
Diffstat (limited to 'src/mongo/db/concurrency/lock_state_test.cpp')
-rw-r--r-- | src/mongo/db/concurrency/lock_state_test.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mongo/db/concurrency/lock_state_test.cpp b/src/mongo/db/concurrency/lock_state_test.cpp index 5e72ccc183a..0fba94a73e5 100644 --- a/src/mongo/db/concurrency/lock_state_test.cpp +++ b/src/mongo/db/concurrency/lock_state_test.cpp @@ -124,7 +124,7 @@ namespace mongo { locker.unlockAll(); } - TEST(Locker, WriteTransactionWithCommit) { + TEST(LockerImpl, WriteTransactionWithCommit) { const ResourceId resIdCollection(RESOURCE_COLLECTION, std::string("TestDB.collection")); const ResourceId resIdRecordS(RESOURCE_DOCUMENT, 1); const ResourceId resIdRecordX(RESOURCE_DOCUMENT, 2); @@ -171,7 +171,7 @@ namespace mongo { /** * Test that saveLockerImpl<true> works by examining the output. */ - TEST(Locker, saveAndRestoreGlobal) { + TEST(LockerImpl, saveAndRestoreGlobal) { Locker::LockSnapshot lockInfo; LockerImpl<true> locker(1); @@ -199,7 +199,7 @@ namespace mongo { /** * Test that we don't unlock when we have the global lock more than once. */ - TEST(Locker, saveAndRestoreGlobalAcquiredTwice) { + TEST(LockerImpl, saveAndRestoreGlobalAcquiredTwice) { Locker::LockSnapshot lockInfo; LockerImpl<true> locker(1); @@ -225,7 +225,7 @@ namespace mongo { /** * Tests that restoreLockerImpl<true> works by locking a db and collection and saving + restoring. */ - TEST(Locker, saveAndRestoreDBAndCollection) { + TEST(LockerImpl, saveAndRestoreDBAndCollection) { Locker::LockSnapshot lockInfo; LockerImpl<true> locker(1); |