{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react/issues/6046","repository_url":"https://api.github.com/repos/facebook/react","labels_url":"https://api.github.com/repos/facebook/react/issues/6046/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react/issues/6046/comments","events_url":"https://api.github.com/repos/facebook/react/issues/6046/events","html_url":"https://github.com/facebook/react/pull/6046","id":134068777,"number":6046,"title":"[WIP] New ReactPerf","user":{"login":"gaearon","id":810438,"avatar_url":"https://avatars.githubusercontent.com/u/810438?v=3","gravatar_id":"","url":"https://api.github.com/users/gaearon","html_url":"https://github.com/gaearon","followers_url":"https://api.github.com/users/gaearon/followers","following_url":"https://api.github.com/users/gaearon/following{/other_user}","gists_url":"https://api.github.com/users/gaearon/gists{/gist_id}","starred_url":"https://api.github.com/users/gaearon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaearon/subscriptions","organizations_url":"https://api.github.com/users/gaearon/orgs","repos_url":"https://api.github.com/users/gaearon/repos","events_url":"https://api.github.com/users/gaearon/events{/privacy}","received_events_url":"https://api.github.com/users/gaearon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/react/labels/CLA%20Signed","name":"CLA Signed","color":"e7e7e7"},{"url":"https://api.github.com/repos/facebook/react/labels/Component:%20Addons%20/%20Perf","name":"Component: Addons / Perf","color":"e11d21"},{"url":"https://api.github.com/repos/facebook/react/labels/GH%20Review:%20accepted","name":"GH Review: accepted","color":"009800"},{"url":"https://api.github.com/repos/facebook/react/labels/Type:%20Enhancement","name":"Type: Enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":107,"created_at":"2016-02-16T19:03:28Z","updated_at":"2016-04-28T19:33:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/react/pulls/6046","html_url":"https://github.com/facebook/react/pull/6046","diff_url":"https://github.com/facebook/react/pull/6046.diff","patch_url":"https://github.com/facebook/react/pull/6046.patch"},"body":"This is a work in progress on implementing new ReactPerf as discussed in #6015.\r\n\r\nPer @sebmarkbage’s request, I decided to focus on removing dependencies on internal method names. Data will be explicitly passed to the perf tool from React methods, and we will attempt to not rely on the execution order.\r\n\r\nRather than refactor the existing code, I chose to create a new tool side by side so I can compare their output until I’m confident about correctness. I will later add `PROFILE` feature gates to the calls.\r\n\r\n- [x] Add barebones implementation of new ReactPerf\r\n- [x] It should count `totalTime` for flushes\r\n- [x] It should not count `totalTime` twice for nested flushes (fixes a minor bug in ReactPerf)\r\n- [x] It should not rely on the rendering and mounting stack matching parent hierarchy\r\n- [x] Decide how inclusive measurements work\r\n- [x] Add a safety mechanism to avoid accidentally forgetting `endMeasure()`\r\n- [x] It should count exclusive time for every lifecycle method\r\n- [x] It should include `displayNames` and other component information\r\n- [x] It should reconstruct the parent tree\r\n- [x] It should count `counts` and `created` for components\r\n- [x] It should count `exclusive` times for components\r\n- [x] It should count `inclusive` times for components based on parent tree\r\n- [x] Make it *the* DebugTool\r\n- [x] Make sure teams that replaced ReactDefaultPerf with [wtf](https://google.github.io/tracing-framework/index.html) can keep doing so\r\n- [x] It should implement `printDOM()`\r\n- [x] It should implement `printWasted()`\r\n- [x] Treat stateless components correctly\r\n- [x] Expose the new `ReactPerf` as `react-addons-perf`\r\n- [x] Make sure wasted measurements are useful (something’s off right now)\r\n- [ ] Do we want to rely on owner?\r\n- [ ] TESTS\r\n- [ ] Remove the old ReactPerf code\r\n- [ ] Introduce the new `PROFILE` gate and put calls behind it\r\n- [x] Consider the implications of using `WeakMap` in `__PROFILE__` builds\r\n- [ ] Expose `React.unstable_Instrumentation`\r\n- [x] Make sure we have new `get*()` methods and deprecated `printDOM()` and `getMeasurementSummaryMap()` are still there\r\n- [ ] Expose whatever React Native needs for systrace integration and enabling `PROFILE`\r\n- [ ] Verify compatibility with React ART (e.g. add [stuff like this](https://github.com/facebook/react-devtools/blob/master/backend/getData.js#L87-L89))\r\n- [ ] Ensure we throw a meaningful error when [`start()` is called inside the lifecycle](http://stackoverflow.com/questions/27279488/react-js-performance-tool-addon-throws-cannot-read-property-counts-of-undefin) or, better, consider providing support for that. See also #2095, #3436, https://github.com/lostthetrail/react-ssr-perf\r\n- [ ] New ReactPerf is correct, tested, has no effect in production, is hard to break accidentally when refactoring, and does not rely on implementation details"},"comment":{"url":"https://api.github.com/repos/facebook/react/issues/comments/215537776","html_url":"https://github.com/facebook/react/pull/6046#issuecomment-215537776","issue_url":"https://api.github.com/repos/facebook/react/issues/6046","id":215537776,"user":{"login":"facebook-github-bot-2","id":8397343,"avatar_url":"https://avatars.githubusercontent.com/u/8397343?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook-github-bot-2","html_url":"https://github.com/facebook-github-bot-2","followers_url":"https://api.github.com/users/facebook-github-bot-2/followers","following_url":"https://api.github.com/users/facebook-github-bot-2/following{/other_user}","gists_url":"https://api.github.com/users/facebook-github-bot-2/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook-github-bot-2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook-github-bot-2/subscriptions","organizations_url":"https://api.github.com/users/facebook-github-bot-2/orgs","repos_url":"https://api.github.com/users/facebook-github-bot-2/repos","events_url":"https://api.github.com/users/facebook-github-bot-2/events{/privacy}","received_events_url":"https://api.github.com/users/facebook-github-bot-2/received_events","type":"User","site_admin":false},"created_at":"2016-04-28T19:33:33Z","updated_at":"2016-04-28T19:33:33Z","body":"@gaearon updated the pull request."}}