{"action":"created","issue":{"url":"https://api.github.com/repos/openstf/stf/issues/11","labels_url":"https://api.github.com/repos/openstf/stf/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/openstf/stf/issues/11/comments","events_url":"https://api.github.com/repos/openstf/stf/issues/11/events","html_url":"https://github.com/openstf/stf/issues/11","id":94647123,"number":11,"title":"Screencapture performance","user":{"login":"paulirish","id":39191,"avatar_url":"https://avatars.githubusercontent.com/u/39191?v=3","gravatar_id":"","url":"https://api.github.com/users/paulirish","html_url":"https://github.com/paulirish","followers_url":"https://api.github.com/users/paulirish/followers","following_url":"https://api.github.com/users/paulirish/following{/other_user}","gists_url":"https://api.github.com/users/paulirish/gists{/gist_id}","starred_url":"https://api.github.com/users/paulirish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulirish/subscriptions","organizations_url":"https://api.github.com/users/paulirish/orgs","repos_url":"https://api.github.com/users/paulirish/repos","events_url":"https://api.github.com/users/paulirish/events{/privacy}","received_events_url":"https://api.github.com/users/paulirish/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-13T06:05:16Z","updated_at":"2015-07-13T07:11:29Z","closed_at":null,"body":"It's crazy good. seriously. Kicks the pants off Chrome devtools screencasting. :)\r\n\r\n\r\nThat said there appears to be something blocking a solid 60fps.\r\n\r\nHere's what i'm seeing after profiling the full STF app using `about:tracing`\r\n\r\n### one frame of work\r\n![image](https://cloud.githubusercontent.com/assets/39191/8643213/c664bf52-28e5-11e5-80c2-239c8d04b414.png)\r\n\r\n\r\nthe real thing here is that we're in the resourcefetcher for the blob for a long ass time. that's really what's slowing down this process. \r\n\r\nHere's the start: https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp&q=%22%20TRACE_EVENT_ASYNC_BEGIN2(%22blink.net%22,%20%22Resource%22%22&sq=package:chromium&type=cs&l=901\r\nHere's the end: https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp&q=%22TRACE_EVENT_ASYNC_END0(%22blink.net%22,%20%22Resource%22%22&sq=package:chromium&type=cs&l=797\r\n\r\nwhat's interesting to me is that if i poke inside of the browser process... it reports finishing loading the blob at about halfway: \r\n![image](https://cloud.githubusercontent.com/assets/39191/8643444/c35e7304-28e8-11e5-8a74-3b2cb511331c.png)\r\n(the actual \"requestcomplete\" on the browserthread is offscreen in the screenshot)\r\n\r\nit's possible whatever is handling the blob URL is unimplemented, but right now it appears to be taking longer than I'd expect. might be a chrome bug.\r\n\r\n\r\n### sometimes I see a missed frame\r\n![image](https://cloud.githubusercontent.com/assets/39191/8643223/f3087d96-28e5-11e5-8c32-efa8b936bb7b.png)\r\n\r\nIn these cases we do two image decodes and throw one of them away immediately. \r\nNot sure yet why this is happening.\r\n\r\n\r\n<hr>\r\n\r\nLast thing, I'd consider trying out requestAnimationFrame, only because it provides the scheduler with a lot more information on when you're ready to paint a frame. It has a low-latency mode so you can call rAF immediately once the image has loaded and you should get an instant paint.\r\n\r\n<hr>\r\nHere's the trace file i'm looking at: https://dl.dropboxusercontent.com/u/39519/temp/trace_stf-screencapture.json.gz"},"comment":{"url":"https://api.github.com/repos/openstf/stf/issues/comments/120834546","html_url":"https://github.com/openstf/stf/issues/11#issuecomment-120834546","issue_url":"https://api.github.com/repos/openstf/stf/issues/11","id":120834546,"user":{"login":"gunta","id":657059,"avatar_url":"https://avatars.githubusercontent.com/u/657059?v=3","gravatar_id":"","url":"https://api.github.com/users/gunta","html_url":"https://github.com/gunta","followers_url":"https://api.github.com/users/gunta/followers","following_url":"https://api.github.com/users/gunta/following{/other_user}","gists_url":"https://api.github.com/users/gunta/gists{/gist_id}","starred_url":"https://api.github.com/users/gunta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gunta/subscriptions","organizations_url":"https://api.github.com/users/gunta/orgs","repos_url":"https://api.github.com/users/gunta/repos","events_url":"https://api.github.com/users/gunta/events{/privacy}","received_events_url":"https://api.github.com/users/gunta/received_events","type":"User","site_admin":false},"created_at":"2015-07-13T07:11:29Z","updated_at":"2015-07-13T07:11:29Z","body":"Thank you!\r\nWe'll have a look."}}