- Timestamp:
- May 9, 2005, 8:49:27 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/Makefile.am
r4091 r4131 22 22 AM_CXXFLAGS+=-I$(MAINSRCDIR)/util/animation 23 23 AM_CXXFLAGS+=-I$(MAINSRCDIR)/util/common 24 AM_CXXFLAGS+=-I$(MAINSRCDIR)/subprojects 24 25 25 26 … … 88 89 lib/xmlparser/tinystr.cc \ 89 90 lib/xmlparser/tinyxmlerror.cc \ 90 lib/xmlparser/tinyxmlparser.cc 91 lib/xmlparser/tinyxmlparser.cc \ 92 subprojects/benchmark.cc 91 93 92 94 noinst_HEADERS = orxonox.h \ … … 160 162 lib/gui/gui/gui_banner.h \ 161 163 lib/gui/gui/gui_keys.h \ 162 lib/gui/gui/gui_update.h 164 lib/gui/gui/gui_update.h \ 165 subprojects/benchmark.h 163 166 164 167 libORXgui_a_CPPFLAGS=$(GTK2_CFLAGS) $(GTHREAD_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS) -
orxonox/trunk/src/Makefile.in
r4130 r4131 90 90 vector.$(OBJEXT) curve.$(OBJEXT) glmenu_imagescreen.$(OBJEXT) \ 91 91 tinyxml.$(OBJEXT) tinystr.$(OBJEXT) tinyxmlerror.$(OBJEXT) \ 92 tinyxmlparser.$(OBJEXT) 92 tinyxmlparser.$(OBJEXT) benchmark.$(OBJEXT) 93 93 orxonox_OBJECTS = $(am_orxonox_OBJECTS) 94 94 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) … … 99 99 @AMDEP_TRUE@ ./$(DEPDIR)/animation_player.Po \ 100 100 @AMDEP_TRUE@ ./$(DEPDIR)/array.Po ./$(DEPDIR)/base_entity.Po \ 101 @AMDEP_TRUE@ ./$(DEPDIR)/base_object.Po ./$(DEPDIR)/camera.Po \ 101 @AMDEP_TRUE@ ./$(DEPDIR)/base_object.Po \ 102 @AMDEP_TRUE@ ./$(DEPDIR)/benchmark.Po ./$(DEPDIR)/camera.Po \ 102 103 @AMDEP_TRUE@ ./$(DEPDIR)/campaign.Po \ 103 104 @AMDEP_TRUE@ ./$(DEPDIR)/character_attributes.Po \ … … 271 272 target_vendor = @target_vendor@ 272 273 MAINSRCDIR = . 273 AM_CXXFLAGS = -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/graphics -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/graphics/particles -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/gui/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai -I$(MAINSRCDIR)/util -I$(MAINSRCDIR)/util/animation -I$(MAINSRCDIR)/util/common 274 AM_CXXFLAGS = -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/graphics -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/graphics/particles -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/gui/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai -I$(MAINSRCDIR)/util -I$(MAINSRCDIR)/util/animation -I$(MAINSRCDIR)/util/common -I$(MAINSRCDIR)/subprojects 274 275 noinst_LIBRARIES = libORXgui.a 275 276 orxonox_DEPENDENCIES = libORXgui.a … … 330 331 lib/xmlparser/tinystr.cc \ 331 332 lib/xmlparser/tinyxmlerror.cc \ 332 lib/xmlparser/tinyxmlparser.cc 333 lib/xmlparser/tinyxmlparser.cc \ 334 subprojects/benchmark.cc 333 335 334 336 noinst_HEADERS = orxonox.h \ … … 402 404 lib/gui/gui/gui_banner.h \ 403 405 lib/gui/gui/gui_keys.h \ 404 lib/gui/gui/gui_update.h 406 lib/gui/gui/gui_update.h \ 407 subprojects/benchmark.h 405 408 406 409 libORXgui_a_CPPFLAGS = $(GTK2_CFLAGS) $(GTHREAD_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS) … … 510 513 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base_entity.Po@am__quote@ 511 514 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base_object.Po@am__quote@ 515 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/benchmark.Po@am__quote@ 512 516 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/camera.Po@am__quote@ 513 517 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/campaign.Po@am__quote@ … … 1513 1517 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1514 1518 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tinyxmlparser.obj `if test -f 'lib/xmlparser/tinyxmlparser.cc'; then $(CYGPATH_W) 'lib/xmlparser/tinyxmlparser.cc'; else $(CYGPATH_W) '$(srcdir)/lib/xmlparser/tinyxmlparser.cc'; fi` 1519 1520 benchmark.o: subprojects/benchmark.cc 1521 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT benchmark.o -MD -MP -MF "$(DEPDIR)/benchmark.Tpo" -c -o benchmark.o `test -f 'subprojects/benchmark.cc' || echo '$(srcdir)/'`subprojects/benchmark.cc; \ 1522 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/benchmark.Tpo" "$(DEPDIR)/benchmark.Po"; else rm -f "$(DEPDIR)/benchmark.Tpo"; exit 1; fi 1523 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='subprojects/benchmark.cc' object='benchmark.o' libtool=no @AMDEPBACKSLASH@ 1524 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/benchmark.Po' tmpdepfile='$(DEPDIR)/benchmark.TPo' @AMDEPBACKSLASH@ 1525 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1526 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o benchmark.o `test -f 'subprojects/benchmark.cc' || echo '$(srcdir)/'`subprojects/benchmark.cc 1527 1528 benchmark.obj: subprojects/benchmark.cc 1529 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT benchmark.obj -MD -MP -MF "$(DEPDIR)/benchmark.Tpo" -c -o benchmark.obj `if test -f 'subprojects/benchmark.cc'; then $(CYGPATH_W) 'subprojects/benchmark.cc'; else $(CYGPATH_W) '$(srcdir)/subprojects/benchmark.cc'; fi`; \ 1530 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/benchmark.Tpo" "$(DEPDIR)/benchmark.Po"; else rm -f "$(DEPDIR)/benchmark.Tpo"; exit 1; fi 1531 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='subprojects/benchmark.cc' object='benchmark.obj' libtool=no @AMDEPBACKSLASH@ 1532 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/benchmark.Po' tmpdepfile='$(DEPDIR)/benchmark.TPo' @AMDEPBACKSLASH@ 1533 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1534 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o benchmark.obj `if test -f 'subprojects/benchmark.cc'; then $(CYGPATH_W) 'subprojects/benchmark.cc'; else $(CYGPATH_W) '$(srcdir)/subprojects/benchmark.cc'; fi` 1515 1535 uninstall-info-am: 1516 1536 … … 1636 1656 1637 1657 distdir: $(DISTFILES) 1638 $(mkdir_p) $(distdir)/ai $(distdir)/defs $(distdir)/glmenu $(distdir)/lib/coord $(distdir)/lib/data $(distdir)/lib/graphics $(distdir)/lib/graphics/particles $(distdir)/lib/gui/gui $(distdir)/lib/lang $(distdir)/lib/math $(distdir)/lib/util $(distdir)/network $(distdir)/proto $(distdir)/story_entities $(distdir)/ util $(distdir)/util/animation $(distdir)/util/common $(distdir)/world_entities1658 $(mkdir_p) $(distdir)/ai $(distdir)/defs $(distdir)/glmenu $(distdir)/lib/coord $(distdir)/lib/data $(distdir)/lib/graphics $(distdir)/lib/graphics/particles $(distdir)/lib/gui/gui $(distdir)/lib/lang $(distdir)/lib/math $(distdir)/lib/util $(distdir)/network $(distdir)/proto $(distdir)/story_entities $(distdir)/subprojects $(distdir)/util $(distdir)/util/animation $(distdir)/util/common $(distdir)/world_entities 1639 1659 @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ 1640 1660 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ -
orxonox/trunk/src/orxonox.cc
r4113 r4131 38 38 #include "text_engine.h" 39 39 #include "factory.h" 40 #include "benchmark.h" 40 41 41 42 #include <string.h> … … 410 411 411 412 } 412 413 #if defined __linux__414 415 #include "list.h"416 #include "world_entity.h"417 #include "vector.h"418 #include "player.h"419 #include "base_object.h"420 421 #include <asm/msr.h>422 #include <linux/timex.h>423 424 425 #define LIST_MAX 1000426 #define VECTOR_MAX 1000000427 #define ITERATIONS 10000428 429 430 int startBenchmarks()431 {432 433 printf("===========================================================\n");434 printf("= BENCHMARKS =\n");435 printf("===========================================================\n");436 printf(" the author is not paying any attention to cacheing effects\n");437 printf(" of the CPU.\n\n");438 printf("[title]\t\t\t\t\t [cycles]\t[loops]\n\n");439 // printf("------------------------------------------------------------\n\n");440 441 // first measure the time overhead:442 unsigned long ini, end, dt, tmp;443 rdtscl(ini); rdtscl(end);444 dt = end - ini;445 446 int type = -1;447 /* type -1 == all448 type 0 == framework449 type 1 == vector450 type 2 == quaternion451 type 3 == lists452 */453 if(type == 0 || type == -1)454 {455 /* framework test*/456 457 printf("Generating Objects:\t\t\t\t\t%i\n", ITERATIONS);458 /* ************WorldEntity class test************** */459 WorldEntity* w = NULL;460 int i = 0;461 unsigned long mittel = 0;462 463 for(i = 0; i < ITERATIONS; ++i)464 {465 rdtscl(ini);466 467 WorldEntity* w = new WorldEntity();468 469 rdtscl(end);470 delete w;471 mittel += (end - ini - dt);472 }473 float mi = mittel / (float)ITERATIONS;474 printf(" Generate a WorldEntity object:\t\t%11.2f\n", mi);475 476 /*477 mittel = 0;478 for(i = 0; i < ITERATIONS; ++i)479 {480 rdtscl(ini);481 482 WorldEntity* w = new Primitive(P_SPHERE);483 484 rdtscl(end);485 delete w;486 mittel += (end - ini - dt);487 }488 mi = mittel / (float)ITERATIONS;489 printf(" Generate a Primitive object:\t\t%11.2f\n", mi);490 */491 492 mittel = 0;493 for(i = 0; i < ITERATIONS; ++i)494 {495 rdtscl(ini);496 497 Vector* v = new Vector();498 499 rdtscl(end);500 delete v;501 mittel += (end - ini - dt);502 }503 mi = mittel / (float)ITERATIONS;504 printf(" Generate a Vector object:\t\t%11.2f\n", mi);505 506 507 mittel = 0;508 for(i = 0; i < ITERATIONS; ++i)509 {510 rdtscl(ini);511 512 Quaternion* q = new Quaternion();513 514 rdtscl(end);515 delete q;516 mittel += (end - ini - dt);517 }518 mi = mittel / (float)ITERATIONS;519 printf(" Generate a Quaternion object:\t\t%11.2f\n", mi);520 521 522 523 524 printf("\nCalling function inline &| virtual, \t\t\t%i\n", ITERATIONS);525 mittel = 0;526 w = new WorldEntity();527 for(i = 0; i < ITERATIONS; ++i)528 {529 rdtscl(ini);530 531 w->tick(0.0f);532 533 rdtscl(end);534 mittel += (end - ini - dt);535 }536 //delete w;537 mi = mittel / (float)ITERATIONS;538 printf(" Virt funct tick() of WE: \t\t%11.2f\n", mi);539 540 541 mittel = 0;542 WorldEntity wo;543 for(i = 0; i < ITERATIONS; ++i)544 {545 rdtscl(ini);546 547 wo.tick(0.0f);548 549 rdtscl(end);550 mittel += (end - ini - dt);551 }552 //delete w;553 mi = mittel / (float)ITERATIONS;554 printf(" Inl virt funct tick() of WE v2: \t%11.2f\n", mi);555 556 557 mittel = 0;558 BaseObject* bo = new BaseObject();559 for(i = 0; i < ITERATIONS; ++i)560 {561 rdtscl(ini);562 563 bo->isFinalized();564 565 rdtscl(end);566 mittel += (end - ini - dt);567 }568 //delete w;569 mi = mittel / (float)ITERATIONS;570 printf(" Inl funct BaseObject::isFinazlized(): \t%11.2f\n", mi);571 572 573 tList<WorldEntity>* list = new tList<WorldEntity>();574 575 576 /* ************Primitvie class test************** */577 list = new tList<WorldEntity>();578 579 580 /*581 mittel = 0;582 w = new Primitive(P_SPHERE);583 for(i = 0; i < ITERATIONS; ++i)584 {585 rdtscl(ini);586 587 w->tick(0.0f);588 589 rdtscl(end);590 mittel += (end - ini - dt);591 }592 mi = mittel / (float)ITERATIONS;593 printf(" Call function tick() of Prim:\t\t%11.2f\n", mi);594 */595 596 }597 598 if(type == 1 || type == -1)599 {600 printf("\nDoing some simple vector operations: \t\t\t%i\n", VECTOR_MAX);601 /* vector test */602 Vector* a = new Vector(1.3, 5.3, 4.1);603 Vector* b = new Vector(0.4, 2.5, 6.2);604 Vector* c = new Vector();605 606 unsigned long mittel, ini, end;607 float mi;608 int i = 0;609 // addition610 mittel = 0;611 for(i = 0; i < VECTOR_MAX; ++i)612 {613 rdtscl(ini);614 615 *c = *a + *b;616 617 rdtscl(end);618 mittel += (end - ini - dt);619 }620 mi = mittel / (float)VECTOR_MAX;621 printf(" Addition of two vectors:\t\t%11.2f\n", mi);622 623 // multiplikation624 625 mittel = 0;626 for(i = 0; i < VECTOR_MAX; ++i)627 {628 rdtscl(ini);629 630 *c = a->cross( *b);631 632 rdtscl(end);633 mittel += (end - ini - dt);634 }635 mi = mittel / (float)VECTOR_MAX;636 printf(" CrossMult of two vectors:\t\t%11.2f\n", mi);637 638 }639 if( type == 2 || type == -1)640 {641 /* quaternion test */642 printf("\nDoing some simple quaternion operations: \t\t%i\n", VECTOR_MAX);643 /* vector test */644 Quaternion* a = new Quaternion();645 Quaternion* b = new Quaternion();646 Quaternion* c = new Quaternion();647 648 unsigned long mittel, ini, end;649 float mi;650 int i = 0;651 // quaternion generieren mit spez konstruktor652 mittel = 0;653 Vector* qa = new Vector(4.6, 9.3, 0.4);654 Vector* qb = new Vector(3.5, 6.1, 4.3);655 for(i = 0; i < VECTOR_MAX; ++i)656 {657 rdtscl(ini);658 659 Quaternion* qu = new Quaternion(*qa, *qb);660 661 rdtscl(end);662 delete qu;663 mittel += (end - ini - dt);664 }665 delete a;666 delete b;667 mi = mittel / (float)VECTOR_MAX;668 printf(" Gen. quatern. betw. two vectors:\t%11.2f\n", mi);669 670 671 // multiplication672 mittel = 0;673 for(i = 0; i < VECTOR_MAX; ++i)674 {675 rdtscl(ini);676 677 *c = *a * *b;678 679 rdtscl(end);680 mittel += (end - ini - dt);681 }682 mi = mittel / (float)VECTOR_MAX;683 printf(" Multiplying two quat.(=rot): a * b\t%11.2f\n", mi);684 685 686 687 // rotating a vector by a quaternion688 mittel = 0;689 for(i = 0; i < VECTOR_MAX; ++i)690 {691 rdtscl(ini);692 693 *qa = a->apply(*qb);694 695 rdtscl(end);696 mittel += (end - ini - dt);697 }698 mi = mittel / (float)VECTOR_MAX;699 printf(" Rot a vec by a quat: q->apply(v)\t%11.2f\n", mi);700 701 702 703 // generate rotation matrix704 mittel = 0;705 float matrix[4][4];706 for(i = 0; i < VECTOR_MAX; ++i)707 {708 rdtscl(ini);709 710 a->matrix(matrix);711 712 rdtscl(end);713 mittel += (end - ini - dt);714 }715 mi = mittel / (float)VECTOR_MAX;716 printf(" Generate rot matrix: q->matrix(m)\t%11.2f\n", mi);717 }718 if( type == 3 || type == -1)719 {720 /* list tests*/721 printf("\nList operations tests: \t\t\t\t\t%i\n", LIST_MAX);722 tList<char>* list = new tList<char>();723 char* name;724 725 printf(" Adding[1..10] elements to list, found:\n");726 list->add("1");727 list->add("2");728 list->add("3");729 list->add("4");730 list->add("5");731 list->add("6");732 list->add("7");733 list->add("8");734 list->add("9");735 list->add("10");736 737 /*give list out */738 tIterator<char>* iterator = list->getIterator();739 name = iterator->nextElement();740 printf(" List Elements: \t\t");741 while( name != NULL)742 {743 printf("%s,", name);744 name = iterator->nextElement();745 }746 delete iterator;747 printf("\n");748 749 750 /*removing some elements from the list*/751 printf(" Removing elements [2,3,6,8,10], adding [11] now found:\n");752 list->remove("2");753 list->remove("3");754 list->remove("6");755 list->remove("8");756 list->remove("10");757 list->add("11");758 /*give list out */759 iterator = list->getIterator();760 name = iterator->nextElement();761 printf(" List Elements: \t\t");762 while( name != NULL)763 {764 printf("%s,", name);765 name = iterator->nextElement();766 }767 delete iterator;768 printf("\n");769 770 delete list;771 printf("\nChecking list performance:\t\t\t\t%i\n", LIST_MAX);772 773 tList<int>* plist = new tList<int>();774 unsigned long mittel, ini, end;775 float mi;776 int i = 0;777 mittel = 0;778 for(i = 0; i < LIST_MAX; ++i)779 {780 rdtscl(ini);781 782 plist->add(&i);783 784 rdtscl(end);785 mittel += (end - ini - dt);786 }787 mi = mittel / (float)LIST_MAX;788 printf(" Adding reference to list:\t\t%11.2f\n", mi);789 790 mittel = 0;791 for(i = 0; i < LIST_MAX; ++i)792 {793 rdtscl(ini);794 795 plist->remove(&i);796 797 rdtscl(end);798 mittel += (end - ini - dt);799 }800 mi = mittel / (float)LIST_MAX;801 printf(" Removing 1st reference from list:\t%11.2f\n", mi);802 803 804 printf("\nList operations tests: \t\t\t\t\t%i\n", LIST_MAX);805 list = new tList<char>();806 printf(" Adding[1..10] elements to list, found:\n");807 list->add("1");808 list->add("2");809 list->add("3");810 list->add("4");811 list->add("5");812 list->add("6");813 list->add("7");814 list->add("8");815 list->add("9");816 list->add("10");817 818 /*give list out */819 iterator = list->getIterator();820 name = iterator->nextElement();821 printf(" List Elements: \t\t");822 while( name != NULL)823 {824 printf("%s,", name);825 name = iterator->nextElement();826 }827 delete iterator;828 printf("\n");829 830 831 int c = 0;832 printf(" Going trough list with nextElement(el) func: ");833 name = list->firstElement();834 while(c < 20)835 {836 printf("%s,", name);837 name = list->nextElement(name);838 c++;839 }840 printf("\n");841 842 843 844 }845 846 }847 848 #else849 850 int startBenchmarks()851 {852 PRINTF(1)("Benchmark is not implemented in this system\n");853 }854 855 #endif -
orxonox/trunk/src/orxonox.h
r3660 r4131 77 77 int startHelp(void); 78 78 int startOrxonox(int argc, char** argv); 79 int startBenchmarks(void);80 79 81 80 #endif /* _ORXONOX_H */
Note: See TracChangeset
for help on using the changeset viewer.