{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/loopback/issues/1860","labels_url":"https://api.github.com/repos/strongloop/loopback/issues/1860/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback/issues/1860/comments","events_url":"https://api.github.com/repos/strongloop/loopback/issues/1860/events","html_url":"https://github.com/strongloop/loopback/pull/1860","id":120771140,"number":1860,"title":"Fix replication performance","user":{"login":"bajtos","id":1140553,"avatar_url":"https://avatars.githubusercontent.com/u/1140553?v=3","gravatar_id":"","url":"https://api.github.com/users/bajtos","html_url":"https://github.com/bajtos","followers_url":"https://api.github.com/users/bajtos/followers","following_url":"https://api.github.com/users/bajtos/following{/other_user}","gists_url":"https://api.github.com/users/bajtos/gists{/gist_id}","starred_url":"https://api.github.com/users/bajtos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bajtos/subscriptions","organizations_url":"https://api.github.com/users/bajtos/orgs","repos_url":"https://api.github.com/users/bajtos/repos","events_url":"https://api.github.com/users/bajtos/events{/privacy}","received_events_url":"https://api.github.com/users/bajtos/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/strongloop/loopback/labels/%23review","name":"#review","color":"ededed"}],"state":"open","locked":false,"assignee":{"login":"ritch","id":462228,"avatar_url":"https://avatars.githubusercontent.com/u/462228?v=3","gravatar_id":"","url":"https://api.github.com/users/ritch","html_url":"https://github.com/ritch","followers_url":"https://api.github.com/users/ritch/followers","following_url":"https://api.github.com/users/ritch/following{/other_user}","gists_url":"https://api.github.com/users/ritch/gists{/gist_id}","starred_url":"https://api.github.com/users/ritch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ritch/subscriptions","organizations_url":"https://api.github.com/users/ritch/orgs","repos_url":"https://api.github.com/users/ritch/repos","events_url":"https://api.github.com/users/ritch/events{/privacy}","received_events_url":"https://api.github.com/users/ritch/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-12-07T13:13:47Z","updated_at":"2015-12-08T15:11:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/strongloop/loopback/pulls/1860","html_url":"https://github.com/strongloop/loopback/pull/1860","diff_url":"https://github.com/strongloop/loopback/pull/1860.diff","patch_url":"https://github.com/strongloop/loopback/pull/1860.patch"},"body":"1) Modify `Change.rectify()` to not make any changes to the Change instance\r\n(most notably to not modify the `checkpoint` field) when the tracked\r\nmodel instance was not changed.\r\n\r\nThis should improve the performance of change replication as it reduces\r\nthe number of unnecessary replications.\r\n\r\nFor example, before this commit, every run of `rectifyAll` would\r\ntrigger a full sync of all clients, because all change instances would\r\nbe moved to the current checkpoint.\r\n\r\n2) Modify `Change.rectify` to look up the current checkpoint only when\r\nthere was actually some change made.\r\n\r\nThis should improve the performance of `rectifyAll` when called from a\r\nregular timer and there were no changes made since the last call.\r\nBefore this commit, `rectifyAll` would perform N calls of\r\n`Checkpoint.current` where N is the number of model instances. With\r\nthis commit in place, no call is made.\r\n\r\nConnect to strongloop-internal/scrum-cs/issues/397\r\n\r\n/to @ritch please review"},"comment":{"url":"https://api.github.com/repos/strongloop/loopback/issues/comments/162910420","html_url":"https://github.com/strongloop/loopback/pull/1860#issuecomment-162910420","issue_url":"https://api.github.com/repos/strongloop/loopback/issues/1860","id":162910420,"user":{"login":"ritch","id":462228,"avatar_url":"https://avatars.githubusercontent.com/u/462228?v=3","gravatar_id":"","url":"https://api.github.com/users/ritch","html_url":"https://github.com/ritch","followers_url":"https://api.github.com/users/ritch/followers","following_url":"https://api.github.com/users/ritch/following{/other_user}","gists_url":"https://api.github.com/users/ritch/gists{/gist_id}","starred_url":"https://api.github.com/users/ritch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ritch/subscriptions","organizations_url":"https://api.github.com/users/ritch/orgs","repos_url":"https://api.github.com/users/ritch/repos","events_url":"https://api.github.com/users/ritch/events{/privacy}","received_events_url":"https://api.github.com/users/ritch/received_events","type":"User","site_admin":false},"created_at":"2015-12-08T15:11:33Z","updated_at":"2015-12-08T15:11:33Z","body":"Not a fan of console.warn over debug... Otherwise LGTM"}}