Optimisation

- excessive calls to sql SELECT in genexchange and gxsnet, naive algo

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.6-initdev@7068 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
chrisparker126 2014-01-28 21:47:51 +00:00
parent 3b71e8e140
commit 82b50d3b46
2 changed files with 8 additions and 2 deletions

View File

@ -2247,6 +2247,9 @@ void RsGenExchange::processRecvdMessages()
} }
} }
if(mReceivedMsgs.empty())
return;
std::vector<RsNxsMsg*>::iterator vit = mReceivedMsgs.begin(); std::vector<RsNxsMsg*>::iterator vit = mReceivedMsgs.begin();
GxsMsgReq msgIds; GxsMsgReq msgIds;
std::map<RsNxsMsg*, RsGxsMsgMetaData*> msgs; std::map<RsNxsMsg*, RsGxsMsgMetaData*> msgs;
@ -2370,6 +2373,9 @@ void RsGenExchange::processRecvdGroups()
{ {
RsStackMutex stack(mGenMtx); RsStackMutex stack(mGenMtx);
if(mReceivedGrps.empty())
return;
NxsGrpPendValidVect::iterator vit = mReceivedGrps.begin(); NxsGrpPendValidVect::iterator vit = mReceivedGrps.begin();
std::vector<std::string> existingGrpIds; std::vector<std::string> existingGrpIds;
std::list<std::string> grpIds; std::list<std::string> grpIds;

View File

@ -872,7 +872,7 @@ bool RsGxsNetService::locked_processTransac(RsNxsTransac* item)
void RsGxsNetService::run(){ void RsGxsNetService::run(){
double timeDelta = 0.2; double timeDelta = 0.5;
int updateCounter = 0; int updateCounter = 0;
while(isRunning()){ while(isRunning()){
@ -883,7 +883,7 @@ void RsGxsNetService::run(){
Sleep((int) (timeDelta * 1000)); Sleep((int) (timeDelta * 1000));
#endif #endif
if(updateCounter == 3) if(updateCounter == 20)
{ {
updateServerSyncTS(); updateServerSyncTS();
updateCounter = 0; updateCounter = 0;