From: Hesham <hes...@gm...> - 2008-01-27 13:35:47
|
Hi all, After profiling the server I saw SDL_GetTicks() is taking around 25% of the time (in the tests I used 7 robots and with the single thread mode). To make long short, I saw this loop (while) in simulationserver.cpp: void SimulationServer::Run(int argc, char** argv) { .... if (mAutoTime) { AdvanceTime(mSimStep); cout<<"AutoTime"<<endl; } else { while (int(mSumDeltaTime*100) < int(mSimStep*100)) { inputCtr->StartCycle();// advance the time } } .... Since SimulationServer::Step() takes care of this case (int(mSumDeltaTime*100) < int(mSimStep*100)) I thought that while in Run() is not necessary. So after commenting it out, SDL_GetTicks() takes less than 10% of the time: void SimulationServer::Run(int argc, char** argv) { .... if (mAutoTime) { AdvanceTime(mSimStep); cout<<"AutoTime"<<endl; } else { inputCtr->StartCycle();// advance the time } .... BTW, the other day I came across the multi-threaded version of ODE by Intel. I think it's worth a try if Yuan has time to help :-) There is something wrong with the multi-threaded mode of the server on my system. So first I need to find out what's the problem. Bests, Hesham |