{"action":"created","issue":{"url":"https://api.github.com/repos/highfidelity/hifi/issues/5885","labels_url":"https://api.github.com/repos/highfidelity/hifi/issues/5885/labels{/name}","comments_url":"https://api.github.com/repos/highfidelity/hifi/issues/5885/comments","events_url":"https://api.github.com/repos/highfidelity/hifi/issues/5885/events","html_url":"https://github.com/highfidelity/hifi/pull/5885","id":108014204,"number":5885,"title":"Batch optimizations","user":{"login":"ZappoMan","id":2093195,"avatar_url":"https://avatars.githubusercontent.com/u/2093195?v=3","gravatar_id":"","url":"https://api.github.com/users/ZappoMan","html_url":"https://github.com/ZappoMan","followers_url":"https://api.github.com/users/ZappoMan/followers","following_url":"https://api.github.com/users/ZappoMan/following{/other_user}","gists_url":"https://api.github.com/users/ZappoMan/gists{/gist_id}","starred_url":"https://api.github.com/users/ZappoMan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZappoMan/subscriptions","organizations_url":"https://api.github.com/users/ZappoMan/orgs","repos_url":"https://api.github.com/users/ZappoMan/repos","events_url":"https://api.github.com/users/ZappoMan/events{/privacy}","received_events_url":"https://api.github.com/users/ZappoMan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-09-23T21:51:24Z","updated_at":"2015-09-24T01:34:48Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/highfidelity/hifi/pulls/5885","html_url":"https://github.com/highfidelity/hifi/pull/5885","diff_url":"https://github.com/highfidelity/hifi/pull/5885.diff","patch_url":"https://github.com/highfidelity/hifi/pull/5885.patch"},"body":"gpu::Batch makes heavy use of std::vector<> for various internal caches. We determined that there was significant amount of memory allocation thrashing going on because we'd reset these vectors every frame and add to them with push_back(), but in general each batch will have the same sized vectors between frames, and so we would prefer to reserve() the correct size for the batch in question.\r\n\r\nTo solve this we introduce gpu::Batch::CacheState which maintains the current size of all the Batches caches. Batches can now be initialized with a CacheState which will reserve the needed cache sizes on construction of the Batch therefor saving in allocation thrashing.\r\n\r\nI also moved the handle doInBatch() helper into Batch.h and implemented automatic support for reusing a CacheState for each unique caller of doInBatch()"},"comment":{"url":"https://api.github.com/repos/highfidelity/hifi/issues/comments/142778742","html_url":"https://github.com/highfidelity/hifi/pull/5885#issuecomment-142778742","issue_url":"https://api.github.com/repos/highfidelity/hifi/issues/5885","id":142778742,"user":{"login":"ZappoMan","id":2093195,"avatar_url":"https://avatars.githubusercontent.com/u/2093195?v=3","gravatar_id":"","url":"https://api.github.com/users/ZappoMan","html_url":"https://github.com/ZappoMan","followers_url":"https://api.github.com/users/ZappoMan/followers","following_url":"https://api.github.com/users/ZappoMan/following{/other_user}","gists_url":"https://api.github.com/users/ZappoMan/gists{/gist_id}","starred_url":"https://api.github.com/users/ZappoMan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZappoMan/subscriptions","organizations_url":"https://api.github.com/users/ZappoMan/orgs","repos_url":"https://api.github.com/users/ZappoMan/repos","events_url":"https://api.github.com/users/ZappoMan/events{/privacy}","received_events_url":"https://api.github.com/users/ZappoMan/received_events","type":"User","site_admin":false},"created_at":"2015-09-24T01:34:48Z","updated_at":"2015-09-24T01:34:48Z","body":"test this please"}}