mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
perftest spinlock
This commit is contained in:
parent
2373b058fd
commit
ab5d034f2d
@ -427,6 +427,7 @@ namespace PerfTests {
|
||||
RWLock lk("testrw");
|
||||
SimpleMutex m("simptst");
|
||||
mongo::mutex mtest("mtest");
|
||||
SpinLock s;
|
||||
|
||||
class mutexspeed : public B {
|
||||
public:
|
||||
@ -446,6 +447,16 @@ namespace PerfTests {
|
||||
SimpleMutex::scoped_lock lk(m);
|
||||
}
|
||||
};
|
||||
class spinlockspeed : public B {
|
||||
public:
|
||||
string name() { return "spinlock"; }
|
||||
virtual int howLongMillis() { return 500; }
|
||||
virtual bool showDurStats() { return false; }
|
||||
void timed() {
|
||||
mongo::scoped_spinlock lk(s);
|
||||
}
|
||||
};
|
||||
|
||||
class rlock : public B {
|
||||
public:
|
||||
string name() { return "rlock"; }
|
||||
@ -810,6 +821,7 @@ namespace PerfTests {
|
||||
add< ulock >();
|
||||
add< mutexspeed >();
|
||||
add< simplemutexspeed >();
|
||||
add< spinlockspeed >();
|
||||
add< CTM >();
|
||||
add< KeyTest >();
|
||||
add< Bldr >();
|
||||
|
Loading…
Reference in New Issue
Block a user