{"action":"created","issue":{"url":"https://api.github.com/repos/mogujie/TeamTalk/issues/4","labels_url":"https://api.github.com/repos/mogujie/TeamTalk/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/mogujie/TeamTalk/issues/4/comments","events_url":"https://api.github.com/repos/mogujie/TeamTalk/issues/4/events","html_url":"https://github.com/mogujie/TeamTalk/issues/4","id":66740813,"number":4,"title":"超时检测的性能问题","user":{"login":"ZYWJ","id":5554211,"avatar_url":"https://avatars.githubusercontent.com/u/5554211?v=3","gravatar_id":"","url":"https://api.github.com/users/ZYWJ","html_url":"https://github.com/ZYWJ","followers_url":"https://api.github.com/users/ZYWJ/followers","following_url":"https://api.github.com/users/ZYWJ/following{/other_user}","gists_url":"https://api.github.com/users/ZYWJ/gists{/gist_id}","starred_url":"https://api.github.com/users/ZYWJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZYWJ/subscriptions","organizations_url":"https://api.github.com/users/ZYWJ/orgs","repos_url":"https://api.github.com/users/ZYWJ/repos","events_url":"https://api.github.com/users/ZYWJ/events{/privacy}","received_events_url":"https://api.github.com/users/ZYWJ/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-07T00:41:45Z","updated_at":"2015-04-07T03:18:47Z","closed_at":"2015-04-07T03:18:47Z","body":"server端，msg_server/MsgConn.cpp中以下函数在并发量大时是否会遇到性能问题，因为要遍历检测所有连接的超时和检测消息确认的超时情况。\r\n\r\n```cpp\r\nvoid msg_conn_timer_callback(void* callback_data, uint8_t msg, uint32_t handle, void* pParam)\r\n{\r\n\tConnMap_t::iterator it_old;\r\n\tCMsgConn* pConn = NULL;\r\n\tuint64_t cur_time = get_tick_count();\r\n\r\n\tfor (ConnMap_t::iterator it = g_msg_conn_map.begin(); it != g_msg_conn_map.end(); ) {\r\n\t\tit_old = it;\r\n\t\tit++;\r\n\r\n\t\tpConn = (CMsgConn*)it_old->second;\r\n\t\tpConn->OnTimer(cur_time);\r\n\t}\r\n\r\n\tif (cur_time > g_last_stat_tick + LOG_MSG_STAT_INTERVAL) {\r\n\t\tg_last_stat_tick = cur_time;\r\n\t\tlog(\"up_msg_cnt=%u, up_msg_miss_cnt=%u, down_msg_cnt=%u, down_msg_miss_cnt=%u \",\r\n\t\t\tg_up_msg_total_cnt, g_up_msg_miss_cnt, g_down_msg_total_cnt, g_down_msg_miss_cnt);\r\n\t}\r\n}\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/mogujie/TeamTalk/issues/comments/90334578","html_url":"https://github.com/mogujie/TeamTalk/issues/4#issuecomment-90334578","issue_url":"https://api.github.com/repos/mogujie/TeamTalk/issues/4","id":90334578,"user":{"login":"bluefoxah","id":5079793,"avatar_url":"https://avatars.githubusercontent.com/u/5079793?v=3","gravatar_id":"","url":"https://api.github.com/users/bluefoxah","html_url":"https://github.com/bluefoxah","followers_url":"https://api.github.com/users/bluefoxah/followers","following_url":"https://api.github.com/users/bluefoxah/following{/other_user}","gists_url":"https://api.github.com/users/bluefoxah/gists{/gist_id}","starred_url":"https://api.github.com/users/bluefoxah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluefoxah/subscriptions","organizations_url":"https://api.github.com/users/bluefoxah/orgs","repos_url":"https://api.github.com/users/bluefoxah/repos","events_url":"https://api.github.com/users/bluefoxah/events{/privacy}","received_events_url":"https://api.github.com/users/bluefoxah/received_events","type":"User","site_admin":false},"created_at":"2015-04-07T03:18:47Z","updated_at":"2015-04-07T03:18:47Z","body":"可以将定时器与网络事件loop区分处理。"}}