{"action":"created","comment":{"url":"https://api.github.com/repos/openfl/openfl/pulls/comments/39344188","id":39344188,"diff_hunk":"@@ -244,7 +244,7 @@ import js.html.CanvasRenderingContext2D;\n \t */\n \tpublic function beginGradientFill (type:GradientType, colors:Array<Dynamic>, alphas:Array<Dynamic>, ratios:Array<Dynamic>, matrix:Matrix = null, spreadMethod:Null<SpreadMethod> = null, interpolationMethod:Null<InterpolationMethod> = null, focalPointRatio:Null<Float> = null):Void {\n \t\t\n-\t\t__commands.push (BeginGradientFill (type, colors, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio));\n+\t\t__commands.writeBeginGradientFill (type, cast colors, cast alphas, cast ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio);","path":"openfl/display/Graphics.hx","position":41,"original_position":41,"commit_id":"64d5de16828f81990f29575ba2ac92a5da8acc7b","original_commit_id":"64d5de16828f81990f29575ba2ac92a5da8acc7b","user":{"login":"larsiusprime","id":739064,"avatar_url":"https://avatars.githubusercontent.com/u/739064?v=3","gravatar_id":"","url":"https://api.github.com/users/larsiusprime","html_url":"https://github.com/larsiusprime","followers_url":"https://api.github.com/users/larsiusprime/followers","following_url":"https://api.github.com/users/larsiusprime/following{/other_user}","gists_url":"https://api.github.com/users/larsiusprime/gists{/gist_id}","starred_url":"https://api.github.com/users/larsiusprime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larsiusprime/subscriptions","organizations_url":"https://api.github.com/users/larsiusprime/orgs","repos_url":"https://api.github.com/users/larsiusprime/repos","events_url":"https://api.github.com/users/larsiusprime/events{/privacy}","received_events_url":"https://api.github.com/users/larsiusprime/received_events","type":"User","site_admin":false},"body":"I refactored this b/c I had an error with gradients, and along the way I tried to tighten up the types a bit... only to find out the public api is indeed dynamic for em. I think the actual glitch was a messed up variable in the reader anyway, so the typing was probably of no value anyway given it has to be dynamic in the end. I'll revert it in a bit.","created_at":"2015-09-13T03:49:09Z","updated_at":"2015-09-13T03:49:09Z","html_url":"https://github.com/openfl/openfl/pull/830#discussion_r39344188","pull_request_url":"https://api.github.com/repos/openfl/openfl/pulls/830","_links":{"self":{"href":"https://api.github.com/repos/openfl/openfl/pulls/comments/39344188"},"html":{"href":"https://github.com/openfl/openfl/pull/830#discussion_r39344188"},"pull_request":{"href":"https://api.github.com/repos/openfl/openfl/pulls/830"}}},"pull_request":{"url":"https://api.github.com/repos/openfl/openfl/pulls/830","id":44845647,"html_url":"https://github.com/openfl/openfl/pull/830","diff_url":"https://github.com/openfl/openfl/pull/830.diff","patch_url":"https://github.com/openfl/openfl/pull/830.patch","issue_url":"https://api.github.com/repos/openfl/openfl/issues/830","number":830,"state":"open","locked":false,"title":"Drawcommand refactor","user":{"login":"larsiusprime","id":739064,"avatar_url":"https://avatars.githubusercontent.com/u/739064?v=3","gravatar_id":"","url":"https://api.github.com/users/larsiusprime","html_url":"https://github.com/larsiusprime","followers_url":"https://api.github.com/users/larsiusprime/followers","following_url":"https://api.github.com/users/larsiusprime/following{/other_user}","gists_url":"https://api.github.com/users/larsiusprime/gists{/gist_id}","starred_url":"https://api.github.com/users/larsiusprime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larsiusprime/subscriptions","organizations_url":"https://api.github.com/users/larsiusprime/orgs","repos_url":"https://api.github.com/users/larsiusprime/repos","events_url":"https://api.github.com/users/larsiusprime/events{/privacy}","received_events_url":"https://api.github.com/users/larsiusprime/received_events","type":"User","site_admin":false},"body":"This is the big one!\r\n\r\nThe old DrawCommand used dynamic enums which caused all *sorts* of GC-able allocations, as well as other performance bottlenecks. This fixes all that.\r\n\r\nSummary:\r\n\r\n1. Replace DrawCommand with DrawCommandBuffer\r\n2. Use DrawCommandReader as an abstract view into DrawCommandBuffer\r\n3. Refactor to re-use instance variables where possible to reduce allocations\r\n4. Profit!\r\n\r\nThis works for Defender's Quest quite well, reduces overall memory use, increases performance, and reduces GC-able allocations.\r\n\r\nThat said, such a huge change definitely requires some solid testing before it's pulled in. I have made changes to CanvasGraphics too, for instance, and I've checked my code, but I've not run it extensively. We should run this against demos to make sure it lines up and that there aren't regressions.\r\n\r\nTesting with HxScout, I got like 40% reduced memory, and decimated the GC allocations. YMMV.","created_at":"2015-09-12T03:08:15Z","updated_at":"2015-09-13T03:49:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"db643f2311640382befb4ed22b93ed92f01cfa6b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openfl/openfl/pulls/830/commits","review_comments_url":"https://api.github.com/repos/openfl/openfl/pulls/830/comments","review_comment_url":"https://api.github.com/repos/openfl/openfl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openfl/openfl/issues/830/comments","statuses_url":"https://api.github.com/repos/openfl/openfl/statuses/64d5de16828f81990f29575ba2ac92a5da8acc7b","head":{"label":"larsiusprime:drawcommand_refactor","ref":"drawcommand_refactor","sha":"64d5de16828f81990f29575ba2ac92a5da8acc7b","user":{"login":"larsiusprime","id":739064,"avatar_url":"https://avatars.githubusercontent.com/u/739064?v=3","gravatar_id":"","url":"https://api.github.com/users/larsiusprime","html_url":"https://github.com/larsiusprime","followers_url":"https://api.github.com/users/larsiusprime/followers","following_url":"https://api.github.com/users/larsiusprime/following{/other_user}","gists_url":"https://api.github.com/users/larsiusprime/gists{/gist_id}","starred_url":"https://api.github.com/users/larsiusprime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larsiusprime/subscriptions","organizations_url":"https://api.github.com/users/larsiusprime/orgs","repos_url":"https://api.github.com/users/larsiusprime/repos","events_url":"https://api.github.com/users/larsiusprime/events{/privacy}","received_events_url":"https://api.github.com/users/larsiusprime/received_events","type":"User","site_admin":false},"repo":{"id":12601647,"name":"openfl","full_name":"larsiusprime/openfl","owner":{"login":"larsiusprime","id":739064,"avatar_url":"https://avatars.githubusercontent.com/u/739064?v=3","gravatar_id":"","url":"https://api.github.com/users/larsiusprime","html_url":"https://github.com/larsiusprime","followers_url":"https://api.github.com/users/larsiusprime/followers","following_url":"https://api.github.com/users/larsiusprime/following{/other_user}","gists_url":"https://api.github.com/users/larsiusprime/gists{/gist_id}","starred_url":"https://api.github.com/users/larsiusprime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larsiusprime/subscriptions","organizations_url":"https://api.github.com/users/larsiusprime/orgs","repos_url":"https://api.github.com/users/larsiusprime/repos","events_url":"https://api.github.com/users/larsiusprime/events{/privacy}","received_events_url":"https://api.github.com/users/larsiusprime/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/larsiusprime/openfl","description":"","fork":true,"url":"https://api.github.com/repos/larsiusprime/openfl","forks_url":"https://api.github.com/repos/larsiusprime/openfl/forks","keys_url":"https://api.github.com/repos/larsiusprime/openfl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/larsiusprime/openfl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/larsiusprime/openfl/teams","hooks_url":"https://api.github.com/repos/larsiusprime/openfl/hooks","issue_events_url":"https://api.github.com/repos/larsiusprime/openfl/issues/events{/number}","events_url":"https://api.github.com/repos/larsiusprime/openfl/events","assignees_url":"https://api.github.com/repos/larsiusprime/openfl/assignees{/user}","branches_url":"https://api.github.com/repos/larsiusprime/openfl/branches{/branch}","tags_url":"https://api.github.com/repos/larsiusprime/openfl/tags","blobs_url":"https://api.github.com/repos/larsiusprime/openfl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/larsiusprime/openfl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/larsiusprime/openfl/git/refs{/sha}","trees_url":"https://api.github.com/repos/larsiusprime/openfl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/larsiusprime/openfl/statuses/{sha}","languages_url":"https://api.github.com/repos/larsiusprime/openfl/languages","stargazers_url":"https://api.github.com/repos/larsiusprime/openfl/stargazers","contributors_url":"https://api.github.com/repos/larsiusprime/openfl/contributors","subscribers_url":"https://api.github.com/repos/larsiusprime/openfl/subscribers","subscription_url":"https://api.github.com/repos/larsiusprime/openfl/subscription","commits_url":"https://api.github.com/repos/larsiusprime/openfl/commits{/sha}","git_commits_url":"https://api.github.com/repos/larsiusprime/openfl/git/commits{/sha}","comments_url":"https://api.github.com/repos/larsiusprime/openfl/comments{/number}","issue_comment_url":"https://api.github.com/repos/larsiusprime/openfl/issues/comments{/number}","contents_url":"https://api.github.com/repos/larsiusprime/openfl/contents/{+path}","compare_url":"https://api.github.com/repos/larsiusprime/openfl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/larsiusprime/openfl/merges","archive_url":"https://api.github.com/repos/larsiusprime/openfl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/larsiusprime/openfl/downloads","issues_url":"https://api.github.com/repos/larsiusprime/openfl/issues{/number}","pulls_url":"https://api.github.com/repos/larsiusprime/openfl/pulls{/number}","milestones_url":"https://api.github.com/repos/larsiusprime/openfl/milestones{/number}","notifications_url":"https://api.github.com/repos/larsiusprime/openfl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/larsiusprime/openfl/labels{/name}","releases_url":"https://api.github.com/repos/larsiusprime/openfl/releases{/id}","created_at":"2013-09-04T20:42:12Z","updated_at":"2015-05-01T21:58:14Z","pushed_at":"2015-09-12T02:47:23Z","git_url":"git://github.com/larsiusprime/openfl.git","ssh_url":"git@github.com:larsiusprime/openfl.git","clone_url":"https://github.com/larsiusprime/openfl.git","svn_url":"https://github.com/larsiusprime/openfl","homepage":"","size":10975,"stargazers_count":0,"watchers_count":0,"language":"Haxe","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openfl:master","ref":"master","sha":"5723c30bcd087860392ff84132f0757aa396bce6","user":{"login":"openfl","id":4061208,"avatar_url":"https://avatars.githubusercontent.com/u/4061208?v=3","gravatar_id":"","url":"https://api.github.com/users/openfl","html_url":"https://github.com/openfl","followers_url":"https://api.github.com/users/openfl/followers","following_url":"https://api.github.com/users/openfl/following{/other_user}","gists_url":"https://api.github.com/users/openfl/gists{/gist_id}","starred_url":"https://api.github.com/users/openfl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openfl/subscriptions","organizations_url":"https://api.github.com/users/openfl/orgs","repos_url":"https://api.github.com/users/openfl/repos","events_url":"https://api.github.com/users/openfl/events{/privacy}","received_events_url":"https://api.github.com/users/openfl/received_events","type":"Organization","site_admin":false},"repo":{"id":8869463,"name":"openfl","full_name":"openfl/openfl","owner":{"login":"openfl","id":4061208,"avatar_url":"https://avatars.githubusercontent.com/u/4061208?v=3","gravatar_id":"","url":"https://api.github.com/users/openfl","html_url":"https://github.com/openfl","followers_url":"https://api.github.com/users/openfl/followers","following_url":"https://api.github.com/users/openfl/following{/other_user}","gists_url":"https://api.github.com/users/openfl/gists{/gist_id}","starred_url":"https://api.github.com/users/openfl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openfl/subscriptions","organizations_url":"https://api.github.com/users/openfl/orgs","repos_url":"https://api.github.com/users/openfl/repos","events_url":"https://api.github.com/users/openfl/events{/privacy}","received_events_url":"https://api.github.com/users/openfl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openfl/openfl","description":"The \"Open Flash Library\" for fast 2D development","fork":false,"url":"https://api.github.com/repos/openfl/openfl","forks_url":"https://api.github.com/repos/openfl/openfl/forks","keys_url":"https://api.github.com/repos/openfl/openfl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openfl/openfl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openfl/openfl/teams","hooks_url":"https://api.github.com/repos/openfl/openfl/hooks","issue_events_url":"https://api.github.com/repos/openfl/openfl/issues/events{/number}","events_url":"https://api.github.com/repos/openfl/openfl/events","assignees_url":"https://api.github.com/repos/openfl/openfl/assignees{/user}","branches_url":"https://api.github.com/repos/openfl/openfl/branches{/branch}","tags_url":"https://api.github.com/repos/openfl/openfl/tags","blobs_url":"https://api.github.com/repos/openfl/openfl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openfl/openfl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openfl/openfl/git/refs{/sha}","trees_url":"https://api.github.com/repos/openfl/openfl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openfl/openfl/statuses/{sha}","languages_url":"https://api.github.com/repos/openfl/openfl/languages","stargazers_url":"https://api.github.com/repos/openfl/openfl/stargazers","contributors_url":"https://api.github.com/repos/openfl/openfl/contributors","subscribers_url":"https://api.github.com/repos/openfl/openfl/subscribers","subscription_url":"https://api.github.com/repos/openfl/openfl/subscription","commits_url":"https://api.github.com/repos/openfl/openfl/commits{/sha}","git_commits_url":"https://api.github.com/repos/openfl/openfl/git/commits{/sha}","comments_url":"https://api.github.com/repos/openfl/openfl/comments{/number}","issue_comment_url":"https://api.github.com/repos/openfl/openfl/issues/comments{/number}","contents_url":"https://api.github.com/repos/openfl/openfl/contents/{+path}","compare_url":"https://api.github.com/repos/openfl/openfl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openfl/openfl/merges","archive_url":"https://api.github.com/repos/openfl/openfl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openfl/openfl/downloads","issues_url":"https://api.github.com/repos/openfl/openfl/issues{/number}","pulls_url":"https://api.github.com/repos/openfl/openfl/pulls{/number}","milestones_url":"https://api.github.com/repos/openfl/openfl/milestones{/number}","notifications_url":"https://api.github.com/repos/openfl/openfl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openfl/openfl/labels{/name}","releases_url":"https://api.github.com/repos/openfl/openfl/releases{/id}","created_at":"2013-03-19T02:50:23Z","updated_at":"2015-09-11T09:17:20Z","pushed_at":"2015-09-12T23:08:36Z","git_url":"git://github.com/openfl/openfl.git","ssh_url":"git@github.com:openfl/openfl.git","clone_url":"https://github.com/openfl/openfl.git","svn_url":"https://github.com/openfl/openfl","homepage":"http://www.openfl.org","size":17920,"stargazers_count":762,"watchers_count":762,"language":"Haxe","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":161,"mirror_url":null,"open_issues_count":175,"forks":161,"open_issues":175,"watchers":762,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openfl/openfl/pulls/830"},"html":{"href":"https://github.com/openfl/openfl/pull/830"},"issue":{"href":"https://api.github.com/repos/openfl/openfl/issues/830"},"comments":{"href":"https://api.github.com/repos/openfl/openfl/issues/830/comments"},"review_comments":{"href":"https://api.github.com/repos/openfl/openfl/pulls/830/comments"},"review_comment":{"href":"https://api.github.com/repos/openfl/openfl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openfl/openfl/pulls/830/commits"},"statuses":{"href":"https://api.github.com/repos/openfl/openfl/statuses/64d5de16828f81990f29575ba2ac92a5da8acc7b"}}}}