diff --git a/dbtests/perftests.cpp b/dbtests/perftests.cpp index b8326b7cc84..a5da27d087e 100644 --- a/dbtests/perftests.cpp +++ b/dbtests/perftests.cpp @@ -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 >(); diff --git a/jstests/capped2.js b/jstests/capped2.js index b55913d5045..1f8bf1d01c6 100644 --- a/jstests/capped2.js +++ b/jstests/capped2.js @@ -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 }; }