Esempio n. 1
0
  void runTest() {
    _chronometer.start();
    for(int i = 0; i < 1000000; i++){
//      string c[] = { "foo", "bar" };
//      string b[2] = c;
    }
    _chronometer.end();
  }
Esempio n. 2
0
		void benchmarkSendUnavailablePresence() {
			Clock clk;
			std::vector<std::string> lst;
			for (int i = 0; i < 1000; i++) {
				pbnetwork::Buddy buddy;
				buddy.set_username("user@localhost");
				buddy.set_buddyname("buddy" + boost::lexical_cast<std::string>(i)  + "@test");
				buddy.set_status((pbnetwork::StatusType) 5);

				std::string message;
				buddy.SerializeToString(&message);
				lst.push_back(message);
			}

			std::vector<std::string> lst2;
			for (int i = 0; i < 1000; i++) {
				pbnetwork::Buddy buddy;
				buddy.set_username("user@localhost");
				buddy.set_buddyname("buddy" + boost::lexical_cast<std::string>(1000+i)  + "@test");
				buddy.set_status((pbnetwork::StatusType) 2);

				std::string message;
				buddy.SerializeToString(&message);
				lst2.push_back(message);
			}

			
			for (int i = 0; i < 1000; i++) {
				serv->handleBuddyChangedPayload(lst[i]);
				received.clear();
			}
			for (int i = 0; i < 1000; i++) {
				serv->handleBuddyChangedPayload(lst2[i]);
				received.clear();
			}

			User *user = userManager->getUser("user@localhost");
			clk.start();
			user->getRosterManager()->sendUnavailablePresences("user@localhost");
			clk.end();
			std::cerr << " " << clk.elapsedTime() << " s";
		}
Esempio n. 3
0
  void runTest() {
    _chronometer.start();
//    int ar1[5] = {1,2,3,4,5}, ar2[5] = {6,7,8,9,10};
//    int ar3[10];
//    std::copy(ar1, ar1+5, ar3);
//    std::copy(ar2, ar2+5, ar3+5);
//    std::cout << ar1<< ar2<< ar3<< "\n";
//    MengerSponge * sponge = new MengerSponge(5);
//    GLfloat verts[3] = {1,2,3};
//    GLuint index[5] = {1,2,1,0,2};
//    Mesh * mesh = new Mesh();
//    mesh->addBuffer(verts, 3, "in_Vertex");
//    mesh->addElementBuffer(index);
//    mesh->setDrawType(GL_TRIANGLES);
//
//       int arr[0];
//       int size = sizeof( arr ) / sizeof( arr[0] );
//      printf("size: %d\n", size );
    _chronometer.end();
  }
Esempio n. 4
0
  void runTest() {
    _chronometer.start();
    for(int i = 0; i < 1000000; i++){
      vector<string> cpp = { "foo", "bar" };
      vector<string> bpp = cpp;
    }
    _chronometer.end();
//
//    MengerSponge * sponge = new MengerSponge(3);
//    Camera * camera = new Camera();
//
//    Light * light = new Light(QVector3D(0, 0, 0),QVector3D(0, -5, 0));
//
//    Material * material = new EmptyMat();
//    Mesh * mesh = new Mesh();
//    Node * node = new Node("", QVector3D(0,0,0), 1, mesh, material);

    //    CPPUNIT_ASSERT( 0 == 0 );

  }