1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761
|
// perftest.cpp : Run db performance tests.
//
/**
* Copyright (C) 2009 10gen Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "pch.h"
#include "../../client/dbclient.h"
#include "../../db/instance.h"
#include "../../db/ops/query.h"
#include "../../db/queryoptimizer.h"
#include "../../util/file_allocator.h"
#include "../framework.h"
#include <boost/date_time/posix_time/posix_time.hpp>
namespace mongo {
extern string dbpath;
} // namespace mongo
using namespace mongo;
using namespace mongo::regression;
DBClientBase *client_;
// Each test runs with a separate db, so no test does any of the startup
// (ie allocation) work for another test.
template< class T >
string testDb( T *t = 0 ) {
string name = mongo::demangleName( typeid( T ) );
// Make filesystem safe.
for( string::iterator i = name.begin(); i != name.end(); ++i )
if ( *i == ':' )
*i = '_';
return name;
}
template< class T >
string testNs( T *t ) {
stringstream ss;
ss << testDb( t ) << ".perftest";
return ss.str();
}
template <class T>
class Runner {
public:
void run() {
T test;
string name = testDb( &test );
boost::posix_time::ptime start = boost::posix_time::microsec_clock::universal_time();
test.run();
boost::posix_time::ptime end = boost::posix_time::microsec_clock::universal_time();
long long micro = ( end - start ).total_microseconds();
cout << "{'" << name << "': "
<< micro / 1000000
<< "."
<< setw( 6 ) << setfill( '0' ) << micro % 1000000
<< "}" << endl;
}
~Runner() {
FileAllocator::get()->waitUntilFinished();
client_->dropDatabase( testDb< T >().c_str() );
}
};
class RunnerSuite : public Suite {
public:
RunnerSuite( string name ) : Suite( name ) {}
protected:
template< class T >
void add() {
Suite::add< Runner< T > >();
}
};
namespace Insert {
class IdIndex {
public:
void run() {
string ns = testNs( this );
for( int i = 0; i < 100000; ++i ) {
client_->insert( ns.c_str(), BSON( "_id" << i ) );
}
}
};
class TwoIndex {
public:
TwoIndex() : ns_( testNs( this ) ) {
client_->ensureIndex( ns_, BSON( "_id" << 1 ), "my_id" );
}
void run() {
for( int i = 0; i < 100000; ++i )
client_->insert( ns_.c_str(), BSON( "_id" << i ) );
}
string ns_;
};
class TenIndex {
public:
TenIndex() : ns_( testNs( this ) ) {
const char *names = "aaaaaaaaa";
for( int i = 0; i < 9; ++i ) {
client_->resetIndexCache();
client_->ensureIndex( ns_.c_str(), BSON( "_id" << 1 ), false, names + i );
}
}
void run() {
for( int i = 0; i < 100000; ++i )
client_->insert( ns_.c_str(), BSON( "_id" << i ) );
}
string ns_;
};
class Capped {
public:
Capped() : ns_( testNs( this ) ) {
client_->createCollection( ns_.c_str(), 100000, true );
}
void run() {
for( int i = 0; i < 100000; ++i )
client_->insert( ns_.c_str(), BSON( "_id" << i ) );
}
string ns_;
};
class OneIndexReverse {
public:
OneIndexReverse() : ns_( testNs( this ) ) {
client_->ensureIndex( ns_, BSON( "_id" << 1 ) );
}
void run() {
for( int i = 0; i < 100000; ++i )
client_->insert( ns_.c_str(), BSON( "_id" << ( 100000 - 1 - i ) ) );
}
string ns_;
};
class OneIndexHighLow {
public:
OneIndexHighLow() : ns_( testNs( this ) ) {
client_->ensureIndex( ns_, BSON( "_id" << 1 ) );
}
void run() {
for( int i = 0; i < 100000; ++i ) {
int j = 50000 + ( ( i % 2 == 0 ) ? 1 : -1 ) * ( i / 2 + 1 );
client_->insert( ns_.c_str(), BSON( "_id" << j ) );
}
}
string ns_;
};
class All : public RunnerSuite {
public:
All() : RunnerSuite( "insert" ) {}
void setupTests() {
add< IdIndex >();
add< TwoIndex >();
add< TenIndex >();
add< Capped >();
add< OneIndexReverse >();
add< OneIndexHighLow >();
}
} all;
} // namespace Insert
namespace Update {
class Smaller {
public:
Smaller() : ns_( testNs( this ) ) {
for( int i = 0; i < 100000; ++i )
client_->insert( ns_.c_str(), BSON( "_id" << i << "b" << 2 ) );
}
void run() {
for( int i = 0; i < 100000; ++i )
client_->update( ns_.c_str(), QUERY( "_id" << i ), BSON( "_id" << i ) );
}
string ns_;
};
class Bigger {
public:
Bigger() : ns_( testNs( this ) ) {
for( int i = 0; i < 100000; ++i )
client_->insert( ns_.c_str(), BSON( "_id" << i ) );
}
void run() {
for( int i = 0; i < 100000; ++i )
client_->update( ns_.c_str(), QUERY( "_id" << i ), BSON( "_id" << i << "b" << 2 ) );
}
string ns_;
};
class Inc {
public:
Inc() : ns_( testNs( this ) ) {
for( int i = 0; i < 10000; ++i )
client_->insert( ns_.c_str(), BSON( "_id" << i << "i" << 0 ) );
}
void run() {
for( int j = 0; j < 10; ++j )
for( int i = 0; i < 10000; ++i )
client_->update( ns_.c_str(), QUERY( "_id" << i ), BSON( "$inc" << BSON( "i" << 1 ) ) );
}
string ns_;
};
class Set {
public:
Set() : ns_( testNs( this ) ) {
for( int i = 0; i < 10000; ++i )
client_->insert( ns_.c_str(), BSON( "_id" << i << "i" << 0 ) );
}
void run() {
for( int j = 1; j < 11; ++j )
for( int i = 0; i < 10000; ++i )
client_->update( ns_.c_str(), QUERY( "_id" << i ), BSON( "$set" << BSON( "i" << j ) ) );
}
string ns_;
};
class SetGrow {
public:
SetGrow() : ns_( testNs( this ) ) {
for( int i = 0; i < 10000; ++i )
client_->insert( ns_.c_str(), BSON( "_id" << i << "i" << "" ) );
}
void run() {
for( int j = 9; j > -1; --j )
for( int i = 0; i < 10000; ++i )
client_->update( ns_.c_str(), QUERY( "_id" << i ), BSON( "$set" << BSON( "i" << "aaaaaaaaaa"[j] ) ) );
}
string ns_;
};
class All : public RunnerSuite {
public:
All() : RunnerSuite( "update" ) {}
void setupTests() {
add< Smaller >();
add< Bigger >();
add< Inc >();
add< Set >();
add< SetGrow >();
}
} all;
} // namespace Update
namespace BSON {
const char *sample =
"{\"one\":2, \"two\":5, \"three\": {},"
"\"four\": { \"five\": { \"six\" : 11 } },"
"\"seven\": [ \"a\", \"bb\", \"ccc\", 5 ],"
"\"eight\": Dbref( \"rrr\", \"01234567890123456789aaaa\" ),"
"\"_id\": ObjectId( \"deadbeefdeadbeefdeadbeef\" ),"
"\"nine\": { \"$binary\": \"abc=\", \"$type\": \"02\" },"
"\"ten\": Date( 44 ), \"eleven\": /foooooo/i }";
const char *shopwikiSample =
"{ '_id' : '289780-80f85380b5c1d4a0ad75d1217673a4a2' , 'site_id' : 289780 , 'title'"
": 'Jubilee - Margaret Walker' , 'image_url' : 'http://www.heartlanddigsandfinds.c"
"om/store/graphics/Product_Graphics/Product_8679.jpg' , 'url' : 'http://www.heartla"
"nddigsandfinds.com/store/store_product_detail.cfm?Product_ID=8679&Category_ID=2&Su"
"b_Category_ID=910' , 'url_hash' : 3450626119933116345 , 'last_update' : null , '"
"features' : { '$imagePrefetchDate' : '2008Aug30 22:39' , '$image.color.rgb' : '5a7"
"574' , 'Price' : '$10.99' , 'Description' : 'Author--s 1st Novel. A Houghton Miffl"
"in Literary Fellowship Award novel by the esteemed poet and novelist who has demon"
"strated a lifelong commitment to the heritage of black culture. An acclaimed story"
"of Vyry, a negro slave during the 19th Century, facing the biggest challenge of h"
"er lifetime - that of gaining her freedom, fighting for all the things she had nev"
"er known before. The author, great-granddaughter of Vyry, reveals what the Civil W"
"ar in America meant to the Negroes. Slavery W' , '$priceHistory-1' : '2008Dec03 $1"
"0.99' , 'Brand' : 'Walker' , '$brands_in_title' : 'Walker' , '--path' : '//HTML[1]"
"/BODY[1]/TABLE[1]/TR[1]/TD[1]/P[1]/TABLE[1]/TR[1]/TD[1]/TABLE[1]/TR[2]/TD[2]/TABLE"
"[1]/TR[1]/TD[1]/P[1]/TABLE[1]/TR[1]' , '~location' : 'en_US' , '$crawled' : '2009J"
"an11 03:22' , '$priceHistory-2' : '2008Nov15 $10.99' , '$priceHistory-0' : '2008De"
"c24 $10.99'}}";
class Parse {
public:
void run() {
for( int i = 0; i < 10000; ++i )
fromjson( sample );
}
};
class ShopwikiParse {
public:
void run() {
for( int i = 0; i < 10000; ++i )
fromjson( shopwikiSample );
}
};
class Json {
public:
Json() : o_( fromjson( sample ) ) {}
void run() {
for( int i = 0; i < 10000; ++i )
o_.jsonString();
}
BSONObj o_;
};
class ShopwikiJson {
public:
ShopwikiJson() : o_( fromjson( shopwikiSample ) ) {}
void run() {
for( int i = 0; i < 10000; ++i )
o_.jsonString();
}
BSONObj o_;
};
template <int LEN>
class Copy {
public:
Copy(){
// putting it in a subobject to force copy on getOwned
BSONObjBuilder outer;
BSONObjBuilder b (outer.subobjStart("inner"));
while (b.len() < LEN)
b.append(BSONObjBuilder::numStr(b.len()), b.len());
b.done();
_base = outer.obj();
}
void run() {
int iterations = 1000*1000;
while (iterations--){
BSONObj temp = copy(_base.firstElement().embeddedObject().getOwned());
}
}
private:
// noinline should force copying even when optimized
NOINLINE_DECL BSONObj copy(BSONObj x){
return x;
}
BSONObj _base;
};
class All : public RunnerSuite {
public:
All() : RunnerSuite( "bson" ) {}
void setupTests() {
add< Parse >();
add< ShopwikiParse >();
add< Json >();
add< ShopwikiJson >();
add< Copy<10> >();
add< Copy<100> >();
add< Copy<1000> >();
add< Copy<10*1000> >();
}
} all;
} // namespace BSON
namespace Index {
class Int {
public:
Int() : ns_( testNs( this ) ) {
for( int i = 0; i < 100000; ++i )
client_->insert( ns_.c_str(), BSON( "a" << i ) );
}
void run() {
client_->ensureIndex( ns_, BSON( "a" << 1 ) );
}
string ns_;
};
class ObjectId {
public:
ObjectId() : ns_( testNs( this ) ) {
OID id;
for( int i = 0; i < 100000; ++i ) {
id.init();
client_->insert( ns_.c_str(), BSON( "a" << id ) );
}
}
void run() {
client_->ensureIndex( ns_, BSON( "a" << 1 ) );
}
string ns_;
};
class String {
public:
String() : ns_( testNs( this ) ) {
for( int i = 0; i < 100000; ++i ) {
stringstream ss;
ss << i;
client_->insert( ns_.c_str(), BSON( "a" << ss.str() ) );
}
}
void run() {
client_->ensureIndex( ns_, BSON( "a" << 1 ) );
}
string ns_;
};
class Object {
public:
Object() : ns_( testNs( this ) ) {
for( int i = 0; i < 100000; ++i ) {
client_->insert( ns_.c_str(), BSON( "a" << BSON( "a" << i ) ) );
}
}
void run() {
client_->ensureIndex( ns_, BSON( "a" << 1 ) );
}
string ns_;
};
class All : public RunnerSuite {
public:
All() : RunnerSuite( "index" ) {}
void setupTests() {
add< Int >();
add< ObjectId >();
add< String >();
add< Object >();
}
} all;
} // namespace Index
namespace QueryTests {
class NoMatch {
public:
NoMatch() : ns_( testNs( this ) ) {
for( int i = 0; i < 100000; ++i )
client_->insert( ns_.c_str(), BSON( "_id" << i ) );
}
void run() {
client_->findOne( ns_.c_str(), QUERY( "_id" << 100000 ) );
}
string ns_;
};
class NoMatchIndex {
public:
NoMatchIndex() : ns_( testNs( this ) ) {
for( int i = 0; i < 100000; ++i )
client_->insert( ns_.c_str(), BSON( "_id" << i ) );
}
void run() {
client_->findOne( ns_.c_str(),
QUERY( "a" << "b" ).hint( BSON( "_id" << 1 ) ) );
}
string ns_;
};
class NoMatchLong {
public:
NoMatchLong() : ns_( testNs( this ) ) {
const char *names = "aaaaaaaaaa";
for( int i = 0; i < 100000; ++i ) {
BSONObjBuilder b;
for( int j = 0; j < 10; ++j )
b << ( names + j ) << i;
client_->insert( ns_.c_str(), b.obj() );
}
}
void run() {
client_->findOne( ns_.c_str(), QUERY( "a" << 100000 ) );
}
string ns_;
};
class SortOrdered {
public:
SortOrdered() : ns_( testNs( this ) ) {
for( int i = 0; i < 50000; ++i )
client_->insert( ns_.c_str(), BSON( "_id" << i ) );
}
void run() {
auto_ptr< DBClientCursor > c =
client_->query( ns_.c_str(), Query( BSONObj() ).sort( BSON( "_id" << 1 ) ) );
int i = 0;
for( ; c->more(); c->nextSafe(), ++i );
ASSERT_EQUALS( 50000, i );
}
string ns_;
};
class SortReverse {
public:
SortReverse() : ns_( testNs( this ) ) {
for( int i = 0; i < 50000; ++i )
client_->insert( ns_.c_str(), BSON( "_id" << ( 50000 - 1 - i ) ) );
}
void run() {
auto_ptr< DBClientCursor > c =
client_->query( ns_.c_str(), Query( BSONObj() ).sort( BSON( "_id" << 1 ) ) );
int i = 0;
for( ; c->more(); c->nextSafe(), ++i );
ASSERT_EQUALS( 50000, i );
}
string ns_;
};
class GetMore {
public:
GetMore() : ns_( testNs( this ) ) {
for( int i = 0; i < 100000; ++i )
client_->insert( ns_.c_str(), BSON( "a" << i ) );
c_ = client_->query( ns_.c_str(), Query() );
}
void run() {
int i = 0;
for( ; c_->more(); c_->nextSafe(), ++i );
ASSERT_EQUALS( 100000, i );
}
string ns_;
auto_ptr< DBClientCursor > c_;
};
class GetMoreIndex {
public:
GetMoreIndex() : ns_( testNs( this ) ) {
for( int i = 0; i < 100000; ++i )
client_->insert( ns_.c_str(), BSON( "a" << i ) );
client_->ensureIndex( ns_, BSON( "a" << 1 ) );
c_ = client_->query( ns_.c_str(), QUERY( "a" << GT << -1 ).hint( BSON( "a" << 1 ) ) );
}
void run() {
int i = 0;
for( ; c_->more(); c_->nextSafe(), ++i );
ASSERT_EQUALS( 100000, i );
}
string ns_;
auto_ptr< DBClientCursor > c_;
};
class GetMoreKeyMatchHelps {
public:
GetMoreKeyMatchHelps() : ns_( testNs( this ) ) {
for( int i = 0; i < 1000000; ++i )
client_->insert( ns_.c_str(), BSON( "a" << i << "b" << i % 10 << "c" << "d" ) );
client_->ensureIndex( ns_, BSON( "a" << 1 << "b" << 1 ) );
c_ = client_->query( ns_.c_str(), QUERY( "a" << GT << -1 << "b" << 0 ).hint( BSON( "a" << 1 << "b" << 1 ) ) );
}
void run() {
int i = 0;
for( ; c_->more(); c_->nextSafe(), ++i );
ASSERT_EQUALS( 100000, i );
}
string ns_;
auto_ptr< DBClientCursor > c_;
};
class All : public RunnerSuite {
public:
All() : RunnerSuite( "query" ) {}
void setupTests() {
add< NoMatch >();
add< NoMatchIndex >();
add< NoMatchLong >();
add< SortOrdered >();
add< SortReverse >();
add< GetMore >();
add< GetMoreIndex >();
add< GetMoreKeyMatchHelps >();
}
} all;
} // namespace QueryTests
namespace Count {
class Count {
public:
Count() : ns_( testNs( this ) ) {
BSONObj obj = BSON( "a" << 1 );
for( int i = 0; i < 100000; ++i )
client_->insert( ns_, obj );
}
void run() {
ASSERT_EQUALS( 100000U, client_->count( ns_, BSON( "a" << 1 ) ) );
}
string ns_;
};
class CountIndex {
public:
CountIndex() : ns_( testNs( this ) ) {
BSONObj obj = BSON( "a" << 1 );
for( int i = 0; i < 100000; ++i )
client_->insert( ns_, obj );
client_->ensureIndex( ns_, obj );
}
void run() {
// 'simple' match does not work for numbers
ASSERT_EQUALS( 100000U, client_->count( ns_, BSON( "a" << 1 ) ) );
}
string ns_;
};
class CountSimpleIndex {
public:
CountSimpleIndex() : ns_( testNs( this ) ) {
BSONObj obj = BSON( "a" << "b" );
for( int i = 0; i < 100000; ++i )
client_->insert( ns_, obj );
client_->ensureIndex( ns_, obj );
}
void run() {
ASSERT_EQUALS( 100000U, client_->count( ns_, BSON( "a" << "b" ) ) );
}
string ns_;
};
class All : public RunnerSuite {
public:
All() : RunnerSuite( "count" ) {}
void setupTests() {
add< Count >();
add< CountIndex >();
add< CountSimpleIndex >();
}
} all;
} // namespace Count
namespace Plan {
class Hint {
public:
Hint() : ns_( testNs( this ) ) {
const char *names = "aaaaaaaaa";
for( int i = 0; i < 9; ++i ) {
client_->resetIndexCache();
client_->ensureIndex( ns_.c_str(), BSON( ( names + i ) << 1 ), false, names + i );
}
lk_.reset( new dblock );
Client::Context ctx( ns_ );
hint_ = BSON( "hint" << BSON( "a" << 1 ) );
hintElt_ = hint_.firstElement();
}
void run() {
for( int i = 0; i < 10000; ++i )
MultiPlanScanner s( ns_.c_str(), BSONObj(), BSONObj(), &hintElt_ );
}
string ns_;
auto_ptr< dblock > lk_;
BSONObj hint_;
BSONElement hintElt_;
};
class Sort {
public:
Sort() : ns_( testNs( this ) ) {
const char *names = "aaaaaaaaaa";
for( int i = 0; i < 10; ++i ) {
client_->resetIndexCache();
client_->ensureIndex( ns_.c_str(), BSON( ( names + i ) << 1 ), false, names + i );
}
lk_.reset( new dblock );
}
void run() {
Client::Context ctx( ns_ );
for( int i = 0; i < 10000; ++i )
MultiPlanScanner s( ns_.c_str(), BSONObj(), BSON( "a" << 1 ) );
}
string ns_;
auto_ptr< dblock > lk_;
};
class Query {
public:
Query() : ns_( testNs( this ) ) {
const char *names = "aaaaaaaaaa";
for( int i = 0; i < 10; ++i ) {
client_->resetIndexCache();
client_->ensureIndex( ns_.c_str(), BSON( ( names + i ) << 1 ), false, names + i );
}
lk_.reset( new dblock );
}
void run() {
Client::Context ctx( ns_.c_str() );
for( int i = 0; i < 10000; ++i )
MultiPlanScanner s( ns_.c_str(), BSON( "a" << 1 ), BSONObj() );
}
string ns_;
auto_ptr< dblock > lk_;
};
class All : public RunnerSuite {
public:
All() : RunnerSuite("plan" ) {}
void setupTests() {
add< Hint >();
add< Sort >();
add< Query >();
}
} all;
} // namespace Plan
namespace Misc {
class TimeMicros64 {
public:
void run() {
int iterations = 1000*1000;
while(iterations--){
curTimeMicros64();
}
}
};
class JSTime {
public:
void run() {
int iterations = 1000*1000;
while(iterations--){
jsTime();
}
}
};
class All : public RunnerSuite {
public:
All() : RunnerSuite("misc") {}
void setupTests() {
add< TimeMicros64 >();
add< JSTime >();
}
} all;
}
int main( int argc, char **argv ) {
logLevel = -1;
client_ = new DBDirectClient();
return Suite::run(argc, argv, "/data/db/perftest");
}
|