{"action":"created","issue":{"url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/14274","labels_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/14274/labels{/name}","comments_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/14274/comments","events_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/14274/events","html_url":"https://github.com/TrinityCore/TrinityCore/issues/14274","id":59420396,"number":14274,"title":"[DEV] Performance Improvements","user":{"login":"jackpoz","id":1153754,"avatar_url":"https://avatars.githubusercontent.com/u/1153754?v=3","gravatar_id":"","url":"https://api.github.com/users/jackpoz","html_url":"https://github.com/jackpoz","followers_url":"https://api.github.com/users/jackpoz/followers","following_url":"https://api.github.com/users/jackpoz/following{/other_user}","gists_url":"https://api.github.com/users/jackpoz/gists{/gist_id}","starred_url":"https://api.github.com/users/jackpoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackpoz/subscriptions","organizations_url":"https://api.github.com/users/jackpoz/orgs","repos_url":"https://api.github.com/users/jackpoz/repos","events_url":"https://api.github.com/users/jackpoz/events{/privacy}","received_events_url":"https://api.github.com/users/jackpoz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/TrinityCore/TrinityCore/labels/Comp-Core","name":"Comp-Core","color":"FF6600"},{"url":"https://api.github.com/repos/TrinityCore/TrinityCore/labels/Priority-FutureFeatureRequest","name":"Priority-FutureFeatureRequest","color":"e102d8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":27,"created_at":"2015-03-01T22:13:21Z","updated_at":"2015-05-19T08:08:54Z","closed_at":null,"body":"This is the list of known performance issues and possible regions of optimization with the goal of allowing a smooth experience in a high-populated server:\r\n- [ ] ACE to boost asio transition seems to have decreased the performances, the 2 libraries should be compared once a proper baseline is found (e.g. 10 groups of 50 players around the world sending small packets)\r\n- [ ] PathGenerator currently calculates the whole path from start to end instead of just retrieving the list of polygons in the path and calculating a portion of the points of that path. The target will most likely move so a lot of calculations will be wasted. The idea is to calculate only the portion that the creature will be able to walk at every Update()\r\n- [x] Log::GetLoggerByType() called for every TC_LOG_TRACE/DEBUG/INFO/WARN seems to be a waster of resources, reaching 3% CPU in a profiling session. https://github.com/TrinityCore/TrinityCore/commit/003d67708b9a279da3d37e5ef06eb32ceab53964 tackles this issue by removing a lot of unneeded calls if there are no loggers using low log levels\r\n- [x] Player::HaveAtClient() does a lookup in a set of guids, reaching 5% CPU in a profiling session. https://github.com/TrinityCore/TrinityCore/commit/49ececf03830ca1d3df45bec1cd7f657d309450b is an attempt to optimize this by using an unordered_set instead, reduing the CPU usage to 2%\r\n- [x] GetOpcodeNameForLogging() formats a string with the current opcode name, reaching 2% CPU in a profiling session. The result is actually used only if TRACE packet logs are enabled, https://github.com/TrinityCore/TrinityCore/commit/5e7d4a44e0d6b92da8ba68a00be00c530a72c873 changes the code behavior to call this function only if the packet logs are enabled\r\n- [ ] Implement proper graphing statistics with low impact on performance to get stats about world loop times, map update times, socket processing times.\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/9092195-dev-performance-improvements?utm_campaign=plugin&utm_content=tracker%2F1310&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1310&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/comments/103391243","html_url":"https://github.com/TrinityCore/TrinityCore/issues/14274#issuecomment-103391243","issue_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/14274","id":103391243,"user":{"login":"DDuarte","id":530940,"avatar_url":"https://avatars.githubusercontent.com/u/530940?v=3","gravatar_id":"","url":"https://api.github.com/users/DDuarte","html_url":"https://github.com/DDuarte","followers_url":"https://api.github.com/users/DDuarte/followers","following_url":"https://api.github.com/users/DDuarte/following{/other_user}","gists_url":"https://api.github.com/users/DDuarte/gists{/gist_id}","starred_url":"https://api.github.com/users/DDuarte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DDuarte/subscriptions","organizations_url":"https://api.github.com/users/DDuarte/orgs","repos_url":"https://api.github.com/users/DDuarte/repos","events_url":"https://api.github.com/users/DDuarte/events{/privacy}","received_events_url":"https://api.github.com/users/DDuarte/received_events","type":"User","site_admin":false},"created_at":"2015-05-19T08:08:54Z","updated_at":"2015-05-19T08:08:54Z","body":"It's the difference of calculating the number of '?' in the preparedstatement strings at compile time or not, since constexpr was only added in VS 2015"}}