{"action":"created","issue":{"url":"https://api.github.com/repos/Urigo/angular-meteor/issues/288","labels_url":"https://api.github.com/repos/Urigo/angular-meteor/issues/288/labels{/name}","comments_url":"https://api.github.com/repos/Urigo/angular-meteor/issues/288/comments","events_url":"https://api.github.com/repos/Urigo/angular-meteor/issues/288/events","html_url":"https://github.com/Urigo/angular-meteor/pull/288","id":67895213,"number":288,"title":"Collection rendering speed improvement","user":{"login":"barbatus","id":2824096,"avatar_url":"https://avatars.githubusercontent.com/u/2824096?v=3","gravatar_id":"","url":"https://api.github.com/users/barbatus","html_url":"https://github.com/barbatus","followers_url":"https://api.github.com/users/barbatus/followers","following_url":"https://api.github.com/users/barbatus/following{/other_user}","gists_url":"https://api.github.com/users/barbatus/gists{/gist_id}","starred_url":"https://api.github.com/users/barbatus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barbatus/subscriptions","organizations_url":"https://api.github.com/users/barbatus/orgs","repos_url":"https://api.github.com/users/barbatus/repos","events_url":"https://api.github.com/users/barbatus/events{/privacy}","received_events_url":"https://api.github.com/users/barbatus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-04-12T09:49:09Z","updated_at":"2015-04-14T17:42:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Urigo/angular-meteor/pulls/288","html_url":"https://github.com/Urigo/angular-meteor/pull/288","diff_url":"https://github.com/Urigo/angular-meteor/pull/288.diff","patch_url":"https://github.com/Urigo/angular-meteor/pull/288.patch"},"body":"Collection rendering speed improvement based on an async apply to combine multiple operations made to the collection."},"comment":{"url":"https://api.github.com/repos/Urigo/angular-meteor/issues/comments/92992919","html_url":"https://github.com/Urigo/angular-meteor/pull/288#issuecomment-92992919","issue_url":"https://api.github.com/repos/Urigo/angular-meteor/issues/288","id":92992919,"user":{"login":"barbatus","id":2824096,"avatar_url":"https://avatars.githubusercontent.com/u/2824096?v=3","gravatar_id":"","url":"https://api.github.com/users/barbatus","html_url":"https://github.com/barbatus","followers_url":"https://api.github.com/users/barbatus/followers","following_url":"https://api.github.com/users/barbatus/following{/other_user}","gists_url":"https://api.github.com/users/barbatus/gists{/gist_id}","starred_url":"https://api.github.com/users/barbatus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barbatus/subscriptions","organizations_url":"https://api.github.com/users/barbatus/orgs","repos_url":"https://api.github.com/users/barbatus/repos","events_url":"https://api.github.com/users/barbatus/events{/privacy}","received_events_url":"https://api.github.com/users/barbatus/received_events","type":"User","site_admin":false},"created_at":"2015-04-14T17:42:24Z","updated_at":"2015-04-14T17:42:24Z","body":"@urigo @netanelgilad That makes sense too.\r\nI also tried to solve it somehow by backing server updates into another one auxiliary collection.\r\nPlease, take a look at the last commit and demo deployed [http://ng-meteor.meteor.com] (http://ng-meteor.meteor.com). I tried to emulate some concurrency as you can see [here] (https://github.com/barbatus/ng-meteor/blob/master/client/views/pages/main_page.js); it just pushes new elements at random intervals before and after updates from server trying to hit an interval when updates are happening. It seems to work correct now. So if you take a look at the console, this line ````diffArray item saved foo added```` appears exactly 10 times as expected no matter when those setTimeouts triggered.\r\nThere also seems to be a bug [here](https://github.com/Urigo/angular-meteor/blob/master/modules/angular-meteor-meteorCollection.js#L256):  ````ngCollection.pop()```` is needed instead.\r\nAs you can see also a duplication of ````$rootScope.$apply()```` is needed [here](https://github.com/barbatus/angular-meteor/commit/502ccd29c69a312f75620db28f0b12bf86c646a6#diff-32cf712277b42c3ac88358aa2911a7f4R169) to work properly  but it can be solved by moving out  ````diffArray```` method in that collection watch into a separate method and then we can save all the differences before ````$rootScope.$apply()````.\r\n\r\n"}}