{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react/issues/2895","labels_url":"https://api.github.com/repos/facebook/react/issues/2895/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react/issues/2895/comments","events_url":"https://api.github.com/repos/facebook/react/issues/2895/events","html_url":"https://github.com/facebook/react/issues/2895","id":55086143,"number":2895,"title":"Optimize _bindAutoBindMethods ","user":{"login":"mridgway","id":191142,"avatar_url":"https://avatars.githubusercontent.com/u/191142?v=3","gravatar_id":"","url":"https://api.github.com/users/mridgway","html_url":"https://github.com/mridgway","followers_url":"https://api.github.com/users/mridgway/followers","following_url":"https://api.github.com/users/mridgway/following{/other_user}","gists_url":"https://api.github.com/users/mridgway/gists{/gist_id}","starred_url":"https://api.github.com/users/mridgway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mridgway/subscriptions","organizations_url":"https://api.github.com/users/mridgway/orgs","repos_url":"https://api.github.com/users/mridgway/repos","events_url":"https://api.github.com/users/mridgway/events{/privacy}","received_events_url":"https://api.github.com/users/mridgway/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-01-21T22:21:19Z","updated_at":"2015-04-09T01:32:05Z","closed_at":null,"body":"We are running into some performance issues using React on the server side. In large component trees, we are finding that render time increases linearly. In our case, we are seeing render times over 80ms for a relatively simple page (112 components). During profiling we have found that the `_bindAutoBindMethods` is showing up at the top of our trace:\r\n\r\n```cli\r\n   ticks  total  nonlib   name\r\n    245    0.6%    0.6%  LazyCompile: ~L._bindAutoBindMethods /Volumes/Projects/app/node_modules/react/dist/react-with-addons.min.js:13\r\n    146    0.4%    0.4%  LazyCompile: ~L.mountComponent /Volumes/Projects/app/node_modules/react/dist/react-with-addons.min.js:13\r\n     75    0.2%    0.2%  LazyCompile: Join native array.js:119\r\n     72    0.2%    0.2%  LazyCompile: bind native v8natives.js:1578\r\n     64    0.2%    0.2%  LazyCompile: ~i.createElement /Volumes/Projects/app/node_modules/react/dist/react-with-addons.min.js:14\r\n     45    0.1%    0.1%  Callback: execute\r\n     38    0.1%    0.1%  LazyCompile: hasOwnProperty native v8natives.js:249\r\n     37    0.1%    0.1%  LazyCompile: *parse native json.js:55\r\n     31    0.1%    0.1%  LazyCompile: *n /Volumes/Projects/app/node_modules/react/dist/react-with-addons.min.js:16\r\n```\r\n\r\nI went in and added hrtime() calls inside `_bindAutoBindMethods` to see how much time was contributing to the rendering, and found that over 23ms was used just within this method. This may not seem like a lot, but this has pretty dramatic effect on throughput when the server is rendering synchronously.\r\n\r\nIs there a way to optimize this so that binding happens lazily? On the server, many of the methods may not even be called (event handlers, lifecycle events, `getDOMNode`, etc.).\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/react/issues/comments/91085716","html_url":"https://github.com/facebook/react/issues/2895#issuecomment-91085716","issue_url":"https://api.github.com/repos/facebook/react/issues/2895","id":91085716,"user":{"login":"spicyj","id":6820,"avatar_url":"https://avatars.githubusercontent.com/u/6820?v=3","gravatar_id":"","url":"https://api.github.com/users/spicyj","html_url":"https://github.com/spicyj","followers_url":"https://api.github.com/users/spicyj/followers","following_url":"https://api.github.com/users/spicyj/following{/other_user}","gists_url":"https://api.github.com/users/spicyj/gists{/gist_id}","starred_url":"https://api.github.com/users/spicyj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spicyj/subscriptions","organizations_url":"https://api.github.com/users/spicyj/orgs","repos_url":"https://api.github.com/users/spicyj/repos","events_url":"https://api.github.com/users/spicyj/events{/privacy}","received_events_url":"https://api.github.com/users/spicyj/received_events","type":"User","site_admin":false},"created_at":"2015-04-09T01:32:04Z","updated_at":"2015-04-09T01:32:04Z","body":"(Wondering if this is #812.)"}}