{"action":"created","issue":{"url":"https://api.github.com/repos/OpenApoc/OpenApoc/issues/142","repository_url":"https://api.github.com/repos/OpenApoc/OpenApoc","labels_url":"https://api.github.com/repos/OpenApoc/OpenApoc/issues/142/labels{/name}","comments_url":"https://api.github.com/repos/OpenApoc/OpenApoc/issues/142/comments","events_url":"https://api.github.com/repos/OpenApoc/OpenApoc/issues/142/events","html_url":"https://github.com/OpenApoc/OpenApoc/issues/142","id":258116282,"number":142,"title":"Engine performance in battlescape and ways to improve it","user":{"login":"Istrebitel","id":952376,"avatar_url":"https://avatars2.githubusercontent.com/u/952376?v=4","gravatar_id":"","url":"https://api.github.com/users/Istrebitel","html_url":"https://github.com/Istrebitel","followers_url":"https://api.github.com/users/Istrebitel/followers","following_url":"https://api.github.com/users/Istrebitel/following{/other_user}","gists_url":"https://api.github.com/users/Istrebitel/gists{/gist_id}","starred_url":"https://api.github.com/users/Istrebitel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Istrebitel/subscriptions","organizations_url":"https://api.github.com/users/Istrebitel/orgs","repos_url":"https://api.github.com/users/Istrebitel/repos","events_url":"https://api.github.com/users/Istrebitel/events{/privacy}","received_events_url":"https://api.github.com/users/Istrebitel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"SupSuper","id":603444,"avatar_url":"https://avatars2.githubusercontent.com/u/603444?v=4","gravatar_id":"","url":"https://api.github.com/users/SupSuper","html_url":"https://github.com/SupSuper","followers_url":"https://api.github.com/users/SupSuper/followers","following_url":"https://api.github.com/users/SupSuper/following{/other_user}","gists_url":"https://api.github.com/users/SupSuper/gists{/gist_id}","starred_url":"https://api.github.com/users/SupSuper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SupSuper/subscriptions","organizations_url":"https://api.github.com/users/SupSuper/orgs","repos_url":"https://api.github.com/users/SupSuper/repos","events_url":"https://api.github.com/users/SupSuper/events{/privacy}","received_events_url":"https://api.github.com/users/SupSuper/received_events","type":"User","site_admin":false},"assignees":[{"login":"SupSuper","id":603444,"avatar_url":"https://avatars2.githubusercontent.com/u/603444?v=4","gravatar_id":"","url":"https://api.github.com/users/SupSuper","html_url":"https://github.com/SupSuper","followers_url":"https://api.github.com/users/SupSuper/followers","following_url":"https://api.github.com/users/SupSuper/following{/other_user}","gists_url":"https://api.github.com/users/SupSuper/gists{/gist_id}","starred_url":"https://api.github.com/users/SupSuper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SupSuper/subscriptions","organizations_url":"https://api.github.com/users/SupSuper/orgs","repos_url":"https://api.github.com/users/SupSuper/repos","events_url":"https://api.github.com/users/SupSuper/events{/privacy}","received_events_url":"https://api.github.com/users/SupSuper/received_events","type":"User","site_admin":false},{"login":"JonnyH","id":1218209,"avatar_url":"https://avatars0.githubusercontent.com/u/1218209?v=4","gravatar_id":"","url":"https://api.github.com/users/JonnyH","html_url":"https://github.com/JonnyH","followers_url":"https://api.github.com/users/JonnyH/followers","following_url":"https://api.github.com/users/JonnyH/following{/other_user}","gists_url":"https://api.github.com/users/JonnyH/gists{/gist_id}","starred_url":"https://api.github.com/users/JonnyH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonnyH/subscriptions","organizations_url":"https://api.github.com/users/JonnyH/orgs","repos_url":"https://api.github.com/users/JonnyH/repos","events_url":"https://api.github.com/users/JonnyH/events{/privacy}","received_events_url":"https://api.github.com/users/JonnyH/received_events","type":"User","site_admin":false},{"login":"pmprog","id":1705629,"avatar_url":"https://avatars2.githubusercontent.com/u/1705629?v=4","gravatar_id":"","url":"https://api.github.com/users/pmprog","html_url":"https://github.com/pmprog","followers_url":"https://api.github.com/users/pmprog/followers","following_url":"https://api.github.com/users/pmprog/following{/other_user}","gists_url":"https://api.github.com/users/pmprog/gists{/gist_id}","starred_url":"https://api.github.com/users/pmprog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmprog/subscriptions","organizations_url":"https://api.github.com/users/pmprog/orgs","repos_url":"https://api.github.com/users/pmprog/repos","events_url":"https://api.github.com/users/pmprog/events{/privacy}","received_events_url":"https://api.github.com/users/pmprog/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2017-09-15T17:51:51Z","updated_at":"2017-09-15T18:04:21Z","closed_at":null,"author_association":"COLLABORATOR","body":"Currently profiling shows that an intense battle (36 anthropods vs base defenses) has processor time spread as follows:\r\n\r\n- 50% on redering, of which:\r\n- 25% (a half) rendering map parts\r\n- 7% on TileObject.getCenter\r\n\r\n- 24% on battle.update, of which:\r\n- 10% updating map parts\r\n- 7% updating units, of which\r\n- 2% unit AI\r\n- 2% unit movement\r\n\r\nI thought about making several code paths parallel, but it seems that won't improve a lot. How could we improve the most costly part, rendering map parts? It seems mostly spending time on allocation and deallocation if you dig further.\r\n\r\nAnd is it worth paralleling stuff like unit AI and map part update, which takes like about 12% of total load?\r\n\r\nI mean, here's what I could do (and it will take a lot of time):\r\n\r\n1) Right now unit AI is called when unit is updated, and gives a decision which is executed immediately. \r\nInstead, we could run all AI in parallel, store all decisions then execute them all in parallel.\r\n\r\n2) Right now, map parts try to re-link themselves immediately when they die. \r\nInstead, we could add all map parts that need re-linking to a set, and then update them after all map parts are updated. \r\nIf we do some other changes, like, convert fallen map parts into rubble also in the end, not immediately, this would allow us to execute map part update in parallel.\r\n\r\n3) Several other cases could probably go parallel by adopting same model: instead of writing change immediately, store it in some place where we can write simulatenously, and then gather all the info and process it at once.\r\n\r\nIs it worth the time? It looks like no, but I want to confirm. I want OpenApoc to run as good as it can, but at the same time its no use spending time on optimisation that's not worth the effort. Wanted to know your guys' opinion on this."},"comment":{"url":"https://api.github.com/repos/OpenApoc/OpenApoc/issues/comments/329856347","html_url":"https://github.com/OpenApoc/OpenApoc/issues/142#issuecomment-329856347","issue_url":"https://api.github.com/repos/OpenApoc/OpenApoc/issues/142","id":329856347,"user":{"login":"JonnyH","id":1218209,"avatar_url":"https://avatars0.githubusercontent.com/u/1218209?v=4","gravatar_id":"","url":"https://api.github.com/users/JonnyH","html_url":"https://github.com/JonnyH","followers_url":"https://api.github.com/users/JonnyH/followers","following_url":"https://api.github.com/users/JonnyH/following{/other_user}","gists_url":"https://api.github.com/users/JonnyH/gists{/gist_id}","starred_url":"https://api.github.com/users/JonnyH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonnyH/subscriptions","organizations_url":"https://api.github.com/users/JonnyH/orgs","repos_url":"https://api.github.com/users/JonnyH/repos","events_url":"https://api.github.com/users/JonnyH/events{/privacy}","received_events_url":"https://api.github.com/users/JonnyH/received_events","type":"User","site_admin":false},"created_at":"2017-09-15T18:04:21Z","updated_at":"2017-09-15T18:04:21Z","author_association":"COLLABORATOR","body":"Is the 50% \"rendering\" actually in the renderer? I remember the iterators for the actual TileObject loop in draw() being a surprisingly large amount of the profile time in my quick msvc tests.\r\n\r\nIf it is in the renderer - assuming it's using gles30_v2 - which is the fastest and best on a new enough GPU - how much time is spend in flush() compared to the SpriteDrawMachine::draw() calls?"}}
{"actor":{"display_login":"JonnyH"}}