{"action":"closed","issue":{"url":"https://api.github.com/repos/omcljs/om/issues/219","labels_url":"https://api.github.com/repos/omcljs/om/issues/219/labels{/name}","comments_url":"https://api.github.com/repos/omcljs/om/issues/219/comments","events_url":"https://api.github.com/repos/omcljs/om/issues/219/events","html_url":"https://github.com/omcljs/om/issues/219","id":38971366,"number":219,"title":"Improve visibility of re-rendering","user":{"login":"krisajenkins","id":380756,"avatar_url":"https://avatars.githubusercontent.com/u/380756?v=3","gravatar_id":"","url":"https://api.github.com/users/krisajenkins","html_url":"https://github.com/krisajenkins","followers_url":"https://api.github.com/users/krisajenkins/followers","following_url":"https://api.github.com/users/krisajenkins/following{/other_user}","gists_url":"https://api.github.com/users/krisajenkins/gists{/gist_id}","starred_url":"https://api.github.com/users/krisajenkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krisajenkins/subscriptions","organizations_url":"https://api.github.com/users/krisajenkins/orgs","repos_url":"https://api.github.com/users/krisajenkins/repos","events_url":"https://api.github.com/users/krisajenkins/events{/privacy}","received_events_url":"https://api.github.com/users/krisajenkins/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2014-07-29T09:20:16Z","updated_at":"2015-04-02T13:44:18Z","closed_at":"2015-04-02T13:44:18Z","body":"I've been having some performance problems with Om. A little investigation shows that the reason is, I've been passing to much information down the rendering tree - a sub-sub-sub-component is getting a map with everything it cares about, plus lots of things it doesn't care about. Those extra things are causing an irrelevant re-render, so large parts of the page are needlessly recalculated, and performance goes through the floor.\r\n\r\nWhat does this have to do with you? Well, to diagnose, I changed https://github.com/swannodette/om/blob/master/src/om/core.cljs#L239 to something like this:\r\n\r\n```clojure\r\n(let [result (cond\r\n              (not= (-value (aget props \"__om_cursor\"))\r\n                    (-value (aget next-props \"__om_cursor\")))\r\n              true\r\n\r\n              (not (nil? (aget state \"__om_pending_state\")))\r\n              true\r\n\r\n              (not (== (aget props \"__om_index\") (aget next-props \"__om_index\")))\r\n              true\r\n\r\n              :else false)]\r\n  (when result\r\n    (js/console.warn \"OM Recalculating\" (if (satisfies? IDisplayName c)\r\n                                          (display-name c)\r\n                                          (pr-str c))))\r\n  result)\r\n```\r\n\r\nIt's hacked-in diagnostics, but I've found the increased visibility of the re-rendering decision to be enormously useful in tracking down & tuning up performance problems. It's a simple change with a lot of value.\r\n\r\nWould you consider adding something like this to some kind of debug/dev mode? \r\n"}}