Changeset 3650 in orxonox.OLD for orxonox/trunk/src
- Timestamp:
- Mar 24, 2005, 5:51:17 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/orxonox.cc
r3649 r3650 350 350 printf("= BENCHMARKS =\n"); 351 351 printf("===========================================================\n"); 352 printf(" the author is not paying any attention to cacheing effects\n"); 353 printf(" of the CPU.\n\n"); 354 printf("[title]\t\t\t\t\t [cycles]\t[loops]\n\n"); 355 // printf("------------------------------------------------------------\n\n"); 352 356 353 357 // first measure the time overhead: … … 366 370 /* framework test*/ 367 371 368 printf("Generating Objects:\ n");372 printf("Generating Objects:\t\t\t\t\t%i\n", ITERATIONS); 369 373 /* ************WorldEntity class test************** */ 370 374 WorldEntity* w = NULL; … … 383 387 } 384 388 float mi = mittel / (float)ITERATIONS; 385 printf(" Generate a WorldEntity objec [cycles]: \t%f\n", mi);389 printf(" Generate a WorldEntity object:\t\t%11.2f\n", mi); 386 390 387 391 mittel = 0; … … 397 401 } 398 402 mi = mittel / (float)ITERATIONS; 399 printf(" Generate a Primitive objec [cycles]:\t\t%f\n", mi); 400 401 printf("\nCalling function inline &| virtual\n"); 403 printf(" Generate a Primitive object:\t\t%11.2f\n", mi); 404 405 406 mittel = 0; 407 for(i = 0; i < ITERATIONS; ++i) 408 { 409 rdtscl(ini); 410 411 Vector* v = new Vector(); 412 413 rdtscl(end); 414 delete v; 415 mittel += (end - ini - dt); 416 } 417 mi = mittel / (float)ITERATIONS; 418 printf(" Generate a Vector object:\t\t%11.2f\n", mi); 419 420 421 mittel = 0; 422 for(i = 0; i < ITERATIONS; ++i) 423 { 424 rdtscl(ini); 425 426 Quaternion* q = new Quaternion(); 427 428 rdtscl(end); 429 delete q; 430 mittel += (end - ini - dt); 431 } 432 mi = mittel / (float)ITERATIONS; 433 printf(" Generate a Quaternion object:\t\t%11.2f\n", mi); 434 435 436 437 438 printf("\nCalling function inline &| virtual, \t\t\t%i\n", ITERATIONS); 402 439 mittel = 0; 403 440 w = new WorldEntity(); … … 413 450 //delete w; 414 451 mi = mittel / (float)ITERATIONS; 415 printf(" virt funct tick() of WE [cycles]: \t\t%f\n", mi);452 printf(" Virt funct tick() of WE: \t\t%11.2f\n", mi); 416 453 417 454 … … 429 466 //delete w; 430 467 mi = mittel / (float)ITERATIONS; 431 printf(" inl virt funct tick() of WE v2 [cycles]: \t%f\n", mi);468 printf(" Inl virt funct tick() of WE v2: \t%11.2f\n", mi); 432 469 433 470 … … 452 489 } 453 490 mi = mittel / (float)ITERATIONS; 454 printf(" Call function tick() of Prim [cycles]:\t\t%f\n", mi);491 printf(" Call function tick() of Prim:\t\t%11.2f\n", mi); 455 492 456 493 … … 458 495 if(type == 1 || type == -1) 459 496 { 497 printf("\nDoing some simple vector operations: \t\t\t%i\n", VECTOR_MAX); 460 498 /* vector test */ 461 499 Vector* a = new Vector(1.3, 5.3, 4.1); … … 463 501 Vector* c = new Vector(); 464 502 503 unsigned long mittel, ini, end; 504 float mi; 465 505 int i = 0; 466 506 // addition 507 mittel = 0; 467 508 for(i = 0; i < VECTOR_MAX; ++i) 468 509 { 510 rdtscl(ini); 511 469 512 *c = *a + *b; 470 } 513 514 rdtscl(end); 515 mittel += (end - ini - dt); 516 } 517 mi = mittel / (float)VECTOR_MAX; 518 printf(" Addition of two vectors:\t\t%11.2f\n", mi); 471 519 472 520 // multiplikation 521 522 mittel = 0; 473 523 for(i = 0; i < VECTOR_MAX; ++i) 474 524 { 525 rdtscl(ini); 526 475 527 *c = a->cross( *b); 476 } 528 529 rdtscl(end); 530 mittel += (end - ini - dt); 531 } 532 mi = mittel / (float)VECTOR_MAX; 533 printf(" CrossMult of two vectors:\t\t%11.2f\n", mi); 534 477 535 if(type == 1 || type == -1) 478 536 { 479 537 /* quaternion test */ 480 538 printf("\nDoing some simple quaternion operations: \t\t%i\n", VECTOR_MAX); 539 /* vector test */ 540 Quaternion* a = new Quaternion(); 541 Quaternion* b = new Quaternion(); 542 Quaternion* c = new Quaternion(); 543 544 unsigned long mittel, ini, end; 545 float mi; 546 int i = 0; 547 // multiplication 548 mittel = 0; 549 for(i = 0; i < VECTOR_MAX; ++i) 550 { 551 rdtscl(ini); 552 553 *c = *a * *b; 554 555 rdtscl(end); 556 mittel += (end - ini - dt); 557 } 558 mi = mittel / (float)VECTOR_MAX; 559 printf(" Multiplying two quat. (=rot):\t\t%11.2f\n", mi); 560 561 562 // multiplication 563 mittel = 0; 564 for(i = 0; i < VECTOR_MAX; ++i) 565 { 566 rdtscl(ini); 567 568 *c = *a * *b; 569 570 rdtscl(end); 571 mittel += (end - ini - dt); 572 } 573 mi = mittel / (float)VECTOR_MAX; 574 printf(" Multiplying two quat.(=rot):\t\t%11.2f\n", mi); 575 576 481 577 } 482 578
Note: See TracChangeset
for help on using the changeset viewer.