{"action":"created","issue":{"url":"https://api.github.com/repos/meteor/meteor/issues/7328","repository_url":"https://api.github.com/repos/meteor/meteor","labels_url":"https://api.github.com/repos/meteor/meteor/issues/7328/labels{/name}","comments_url":"https://api.github.com/repos/meteor/meteor/issues/7328/comments","events_url":"https://api.github.com/repos/meteor/meteor/issues/7328/events","html_url":"https://github.com/meteor/meteor/pull/7328","id":163044604,"number":7328,"title":"Set stopped computation to null instead of delete (#7326)","user":{"login":"arggh","id":17210302,"avatar_url":"https://avatars.githubusercontent.com/u/17210302?v=3","gravatar_id":"","url":"https://api.github.com/users/arggh","html_url":"https://github.com/arggh","followers_url":"https://api.github.com/users/arggh/followers","following_url":"https://api.github.com/users/arggh/following{/other_user}","gists_url":"https://api.github.com/users/arggh/gists{/gist_id}","starred_url":"https://api.github.com/users/arggh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arggh/subscriptions","organizations_url":"https://api.github.com/users/arggh/orgs","repos_url":"https://api.github.com/users/arggh/repos","events_url":"https://api.github.com/users/arggh/events{/privacy}","received_events_url":"https://api.github.com/users/arggh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-06-29T22:47:53Z","updated_at":"2016-07-06T13:22:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/meteor/meteor/pulls/7328","html_url":"https://github.com/meteor/meteor/pull/7328","diff_url":"https://github.com/meteor/meteor/pull/7328.diff","patch_url":"https://github.com/meteor/meteor/pull/7328.patch"},"body":"Fix for issues https://github.com/meteor/meteor/issues/7326 and https://github.com/meteor/blaze/issues/44\r\n\r\nThis change in Tracker speeds up the removal of Blaze templates with many sub-templates by approximately 5-10x.\r\n\r\nIt replaces the `delete` of a stopped computation by setting it to `null`. Read more [here](http://bertanguven.com/preventing-memory-leaks-in-javascript-null-vs-delete)\r\n\r\nReproduction of the issue used as a benchmark (and a test to verify the effect): https://github.com/arggh/blaze-tmpl-destroy/tree/nosubs\r\n\r\nWithout the fix in Tracker, the first time hiding the table with 550 rows took about **1.5 seconds**. On the second go it took about **2.6 seconds**. Then **3.5 seconds**. Then **~5 seconds** and so on, which is really strange - as if things just got incremented instead of removed.\r\n\r\nWith the fix applied, hiding the same table takes a constant **300-450ms.**"},"comment":{"url":"https://api.github.com/repos/meteor/meteor/issues/comments/230769491","html_url":"https://github.com/meteor/meteor/pull/7328#issuecomment-230769491","issue_url":"https://api.github.com/repos/meteor/meteor/issues/7328","id":230769491,"user":{"login":"benjamn","id":5750,"avatar_url":"https://avatars.githubusercontent.com/u/5750?v=3","gravatar_id":"","url":"https://api.github.com/users/benjamn","html_url":"https://github.com/benjamn","followers_url":"https://api.github.com/users/benjamn/followers","following_url":"https://api.github.com/users/benjamn/following{/other_user}","gists_url":"https://api.github.com/users/benjamn/gists{/gist_id}","starred_url":"https://api.github.com/users/benjamn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjamn/subscriptions","organizations_url":"https://api.github.com/users/benjamn/orgs","repos_url":"https://api.github.com/users/benjamn/repos","events_url":"https://api.github.com/users/benjamn/events{/privacy}","received_events_url":"https://api.github.com/users/benjamn/received_events","type":"User","site_admin":false},"created_at":"2016-07-06T13:22:58Z","updated_at":"2016-07-06T13:22:58Z","body":"My one worry with this change is that the `Tracker._computations` object will keep accumulating (tons of) keys, which is potentially a memory leak. For that reason, I would much prefer removing `Tracker._computations` altogether, since it's never been documented and no one (that we know of) uses it. Presumably doing nothing is even faster than setting `Tracker._computations[self._id] = null`."}}
{"actor":{"display_login":"benjamn"}}