{"action":"created","issue":{"url":"https://api.github.com/repos/processing-js/processing-js/issues/218","labels_url":"https://api.github.com/repos/processing-js/processing-js/issues/218/labels{/name}","comments_url":"https://api.github.com/repos/processing-js/processing-js/issues/218/comments","events_url":"https://api.github.com/repos/processing-js/processing-js/issues/218/events","html_url":"https://github.com/processing-js/processing-js/issues/218","id":121651416,"number":218,"title":"image() calls putImageData() even if the imageData hasn't changed","user":{"login":"piersh","id":1088194,"avatar_url":"https://avatars.githubusercontent.com/u/1088194?v=3","gravatar_id":"","url":"https://api.github.com/users/piersh","html_url":"https://github.com/piersh","followers_url":"https://api.github.com/users/piersh/followers","following_url":"https://api.github.com/users/piersh/following{/other_user}","gists_url":"https://api.github.com/users/piersh/gists{/gist_id}","starred_url":"https://api.github.com/users/piersh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piersh/subscriptions","organizations_url":"https://api.github.com/users/piersh/orgs","repos_url":"https://api.github.com/users/piersh/repos","events_url":"https://api.github.com/users/piersh/events{/privacy}","received_events_url":"https://api.github.com/users/piersh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-11T07:02:24Z","updated_at":"2015-12-12T03:53:11Z","closed_at":null,"body":"````\r\nvar gr = createGraphics(400,400,P2D);\r\nimage(gr, 0, 0);\r\nimage(gr, 0, 0);\r\n````\r\n\r\nnotice that during the 2nd `image()` call, the contents of `gr` hasn't changed, but `getCanvasData()` initializes a canvas and calls `putImageData()` again anyway. for repeated drawing of large images this is incredibly wasteful. it would be much better to have `gr` cache its canvas until the next `gr.beginDraw()` call.\r\n\r\non my machine here, each 400x400 image call takes 123ms (95% of which is in `putImageData()`), so drawing just 8 images drops my FPS down to 1. per second."},"comment":{"url":"https://api.github.com/repos/processing-js/processing-js/issues/comments/164107733","html_url":"https://github.com/processing-js/processing-js/issues/218#issuecomment-164107733","issue_url":"https://api.github.com/repos/processing-js/processing-js/issues/218","id":164107733,"user":{"login":"Pomax","id":177243,"avatar_url":"https://avatars.githubusercontent.com/u/177243?v=3","gravatar_id":"","url":"https://api.github.com/users/Pomax","html_url":"https://github.com/Pomax","followers_url":"https://api.github.com/users/Pomax/followers","following_url":"https://api.github.com/users/Pomax/following{/other_user}","gists_url":"https://api.github.com/users/Pomax/gists{/gist_id}","starred_url":"https://api.github.com/users/Pomax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pomax/subscriptions","organizations_url":"https://api.github.com/users/Pomax/orgs","repos_url":"https://api.github.com/users/Pomax/repos","events_url":"https://api.github.com/users/Pomax/events{/privacy}","received_events_url":"https://api.github.com/users/Pomax/received_events","type":"User","site_admin":false},"created_at":"2015-12-12T03:53:11Z","updated_at":"2015-12-12T03:53:11Z","body":"the instaclose was me hitting close instead of comment while rushing between sessions at an all-staff workweek, let's reopen that."}}