{"action":"opened","issue":{"url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/7949","repository_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2","labels_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/7949/labels{/name}","comments_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/7949/comments","events_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/7949/events","html_url":"https://github.com/OpenRCT2/OpenRCT2/issues/7949","id":354911513,"node_id":"MDU6SXNzdWUzNTQ5MTE1MTM=","number":7949,"title":"Use unique_ptr vs shared_ptr for the Context.","user":{"login":"ZehMatt","id":5415177,"node_id":"MDQ6VXNlcjU0MTUxNzc=","avatar_url":"https://avatars0.githubusercontent.com/u/5415177?v=4","gravatar_id":"","url":"https://api.github.com/users/ZehMatt","html_url":"https://github.com/ZehMatt","followers_url":"https://api.github.com/users/ZehMatt/followers","following_url":"https://api.github.com/users/ZehMatt/following{/other_user}","gists_url":"https://api.github.com/users/ZehMatt/gists{/gist_id}","starred_url":"https://api.github.com/users/ZehMatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZehMatt/subscriptions","organizations_url":"https://api.github.com/users/ZehMatt/orgs","repos_url":"https://api.github.com/users/ZehMatt/repos","events_url":"https://api.github.com/users/ZehMatt/events{/privacy}","received_events_url":"https://api.github.com/users/ZehMatt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-28T21:30:03Z","updated_at":"2018-08-28T21:30:03Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"It appears std::shared_ptr was recently Introduced into the context and it turns out this added a significant overhead to the runtime. If the context is supposed to be the owner of all things such as ObjectManager/ObjectRepository then we should probably use unique_ptr and return references instead std::shared_ptr copies. The memory should be valid as long the context exists, if that can't be guaranteed then theres probably design flaw.\r\n\r\n![sleepy_2018-08-28_23-14-57](https://user-images.githubusercontent.com/5415177/44752047-2ac73d80-ab1a-11e8-974f-ae05b8402fc5.jpg)\r\n\r\nThis is one of my profiling sessions where OpenRCT2::Context::GetObjectManager is clearly one of the hot paths due to the many copies required per surface."}}
{"actor":{"display_login":"ZehMatt"}}