0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00

more perftest

This commit is contained in:
Dwight 2011-05-04 12:23:20 -04:00
parent 3bb52716f1
commit 3848e82964
2 changed files with 32 additions and 2 deletions

View File

@ -286,10 +286,24 @@ namespace PerfTests {
}
};
// if a test is this fast, it was optimized out
class Dummy : public B {
public:
Dummy() { }
virtual int howLongMillis() { return 4000; }
string name() { return "dummy"; }
void timed() {
dontOptimizeOutHopefully++;
}
unsigned long long expectation() { return 1000000; }
virtual bool showDurStats() { return false; }
};
// test thread local speed
class TLS : public B {
public:
TLS() { }
virtual int howLongMillis() { return 4000; }
string name() { return "thread-local-storage"; }
void timed() {
if( &cc() )
@ -299,6 +313,20 @@ namespace PerfTests {
virtual bool showDurStats() { return false; }
};
class Malloc : public B {
public:
Malloc() { }
virtual int howLongMillis() { return 4000; }
string name() { return "malloc"; }
void timed() {
char *p = new char[128];
if( dontOptimizeOutHopefully++ > 0 )
delete p;
}
unsigned long long expectation() { return 1000000; }
virtual bool showDurStats() { return false; }
};
// test speed of checksum method
class ChecksumTest : public B {
public:
@ -522,10 +550,12 @@ namespace PerfTests {
cout
<< "stats test rps time "
<< dur::stats.curr->_CSVHeader() << endl;
add< Dummy >();
add< TLS >();
add< Malloc >();
add< BSONIter >();
add< ChecksumTest >();
add< TaskQueueTest >();
add< TLS >();
add< InsertDup >();
add< Insert1 >();
add< InsertRandom >();

View File

@ -8,7 +8,7 @@ function debug( x ) {
var val = new Array( 2000 );
var c = "";
for( i = 0; i < 2000; ++i, c += "---" ) {
for( i = 0; i < 2000; ++i, c += "---" ) { // bigger and bigger objects through the array...
val[ i ] = { a: c };
}