{"action":"created","issue":{"url":"https://api.github.com/repos/Flipboard/FLAnimatedImage/issues/117","labels_url":"https://api.github.com/repos/Flipboard/FLAnimatedImage/issues/117/labels{/name}","comments_url":"https://api.github.com/repos/Flipboard/FLAnimatedImage/issues/117/comments","events_url":"https://api.github.com/repos/Flipboard/FLAnimatedImage/issues/117/events","html_url":"https://github.com/Flipboard/FLAnimatedImage/pull/117","id":126314943,"number":117,"title":"Extension considerations","user":{"login":"timonus","id":522951,"avatar_url":"https://avatars.githubusercontent.com/u/522951?v=3","gravatar_id":"","url":"https://api.github.com/users/timonus","html_url":"https://github.com/timonus","followers_url":"https://api.github.com/users/timonus/followers","following_url":"https://api.github.com/users/timonus/following{/other_user}","gists_url":"https://api.github.com/users/timonus/gists{/gist_id}","starred_url":"https://api.github.com/users/timonus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timonus/subscriptions","organizations_url":"https://api.github.com/users/timonus/orgs","repos_url":"https://api.github.com/users/timonus/repos","events_url":"https://api.github.com/users/timonus/events{/privacy}","received_events_url":"https://api.github.com/users/timonus/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"lukescholefield","id":9808245,"avatar_url":"https://avatars.githubusercontent.com/u/9808245?v=3","gravatar_id":"","url":"https://api.github.com/users/lukescholefield","html_url":"https://github.com/lukescholefield","followers_url":"https://api.github.com/users/lukescholefield/followers","following_url":"https://api.github.com/users/lukescholefield/following{/other_user}","gists_url":"https://api.github.com/users/lukescholefield/gists{/gist_id}","starred_url":"https://api.github.com/users/lukescholefield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukescholefield/subscriptions","organizations_url":"https://api.github.com/users/lukescholefield/orgs","repos_url":"https://api.github.com/users/lukescholefield/repos","events_url":"https://api.github.com/users/lukescholefield/events{/privacy}","received_events_url":"https://api.github.com/users/lukescholefield/received_events","type":"User","site_admin":false},"milestone":null,"comments":8,"created_at":"2016-01-13T00:59:37Z","updated_at":"2016-01-15T04:47:00Z","closed_at":"2016-01-15T00:29:25Z","pull_request":{"url":"https://api.github.com/repos/Flipboard/FLAnimatedImage/pulls/117","html_url":"https://github.com/Flipboard/FLAnimatedImage/pull/117","diff_url":"https://github.com/Flipboard/FLAnimatedImage/pull/117.diff","patch_url":"https://github.com/Flipboard/FLAnimatedImage/pull/117.patch"},"body":"This pull request introduces some initialization options to `FLAnimatedImage` that allow clients to configure it in a way that consumes less memory than the default. These settings are:\r\n\r\n1. Specify number of frames to keep in memory: https://github.com/Flipboard/FLAnimatedImage/commit/0b4886003f34d1b89cd1b5ec9552852c08891c15\r\n2. Disable frame predrawing: https://github.com/Flipboard/FLAnimatedImage/commit/4e78f71102a824d831b1b3aa348706b5640985fd\r\n\r\nI took some instruments in different configs\r\n\r\n<table>\r\n<tr><th>Configuration</th><th>Memory Used (\"All Heap & Anonymous VM\" in instruments)</th><th>Delta from Default</tg></tr>\r\n<tr><td>Default</td><td>47.8MB</td><td>N/A</td></tr>\r\n<tr><td>Disable frame preloading</td><td>30.9MB</td><td>16.9MB</td></tr>\r\n<tr><td>Disable frame predrawing</td><td>33.9MB</td><td>13.9MB</td></tr>\r\n<tr><td>Disable frame preloading and predrawing</td><td>28.2MB</td><td>19.6MB</td></tr>\r\n</table>\r\n\r\nThe reason that the memory savings in the final row isn't the sum of both disabled frame preloading and disabled frame predrawing is that predrawing only impacts loaded frames, and when there are fewer frames preloaded disabling predrawing doesn't have as large of an effect.\r\n\r\nI also made the designated initializer take a `CGImageSource` rather than `NSData` because of a PR recently closed on FLAnimatedImage requesting it for more flexibility."},"comment":{"url":"https://api.github.com/repos/Flipboard/FLAnimatedImage/issues/comments/171871269","html_url":"https://github.com/Flipboard/FLAnimatedImage/pull/117#issuecomment-171871269","issue_url":"https://api.github.com/repos/Flipboard/FLAnimatedImage/issues/117","id":171871269,"user":{"login":"timonus","id":522951,"avatar_url":"https://avatars.githubusercontent.com/u/522951?v=3","gravatar_id":"","url":"https://api.github.com/users/timonus","html_url":"https://github.com/timonus","followers_url":"https://api.github.com/users/timonus/followers","following_url":"https://api.github.com/users/timonus/following{/other_user}","gists_url":"https://api.github.com/users/timonus/gists{/gist_id}","starred_url":"https://api.github.com/users/timonus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timonus/subscriptions","organizations_url":"https://api.github.com/users/timonus/orgs","repos_url":"https://api.github.com/users/timonus/repos","events_url":"https://api.github.com/users/timonus/events{/privacy}","received_events_url":"https://api.github.com/users/timonus/received_events","type":"User","site_admin":false},"created_at":"2016-01-15T04:47:00Z","updated_at":"2016-01-15T04:47:00Z","body":"THANK YOU, good to know!"}}