{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/pulls/comments/36215666","id":36215666,"diff_hunk":"@@ -152,18 +164,41 @@\n \n       // Returns the closest feature <li> to the scroll top position passed in.\n       featureInView: function(containerScrollTop) {\n-        var closest = null;\n-        for (var i = 0, li; li = featureLiList_[i]; ++i) {\n-          var dist = li.offsetTop - containerScrollTop;\n-          if (dist < 0) {\n-            dist = -dist * 1.5;\n-          }\n-          if (closest == null || dist < closest.dist) {\n-            closest = this.filtered[i];\n-            closest.dist = dist;\n-          }\n+\n+        // Generate list of features below current scroll position.\n+        var items = featureLiList_.filter(function(el) {\n+          if (el.offsetTop < containerScrollTop) { return el; }","path":"static/elements/chromedash-featurelist.html","position":44,"original_position":44,"commit_id":"64ada4ab32c9057145414adba8c5a9ed87617a5d","original_commit_id":"64ada4ab32c9057145414adba8c5a9ed87617a5d","user":{"login":"samccone","id":883126,"avatar_url":"https://avatars.githubusercontent.com/u/883126?v=3","gravatar_id":"","url":"https://api.github.com/users/samccone","html_url":"https://github.com/samccone","followers_url":"https://api.github.com/users/samccone/followers","following_url":"https://api.github.com/users/samccone/following{/other_user}","gists_url":"https://api.github.com/users/samccone/gists{/gist_id}","starred_url":"https://api.github.com/users/samccone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samccone/subscriptions","organizations_url":"https://api.github.com/users/samccone/orgs","repos_url":"https://api.github.com/users/samccone/repos","events_url":"https://api.github.com/users/samccone/events{/privacy}","received_events_url":"https://api.github.com/users/samccone/received_events","type":"User","site_admin":false},"body":":+1: sgtm \r\n\r\nTIL \r\n\r\n> scroll events are already async in chrome.","created_at":"2015-08-04T17:23:24Z","updated_at":"2015-08-04T17:23:24Z","html_url":"https://github.com/GoogleChrome/chromium-dashboard/pull/228#discussion_r36215666","pull_request_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/pulls/228","_links":{"self":{"href":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/pulls/comments/36215666"},"html":{"href":"https://github.com/GoogleChrome/chromium-dashboard/pull/228#discussion_r36215666"},"pull_request":{"href":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/pulls/228"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/pulls/228","id":41592933,"html_url":"https://github.com/GoogleChrome/chromium-dashboard/pull/228","diff_url":"https://github.com/GoogleChrome/chromium-dashboard/pull/228.diff","patch_url":"https://github.com/GoogleChrome/chromium-dashboard/pull/228.patch","issue_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/issues/228","number":228,"state":"open","locked":false,"title":"Optimize algorithm for selecting milestone on scrolling the feature list","user":{"login":"ebidel","id":238208,"avatar_url":"https://avatars.githubusercontent.com/u/238208?v=3","gravatar_id":"","url":"https://api.github.com/users/ebidel","html_url":"https://github.com/ebidel","followers_url":"https://api.github.com/users/ebidel/followers","following_url":"https://api.github.com/users/ebidel/following{/other_user}","gists_url":"https://api.github.com/users/ebidel/gists{/gist_id}","starred_url":"https://api.github.com/users/ebidel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebidel/subscriptions","organizations_url":"https://api.github.com/users/ebidel/orgs","repos_url":"https://api.github.com/users/ebidel/repos","events_url":"https://api.github.com/users/ebidel/events{/privacy}","received_events_url":"https://api.github.com/users/ebidel/received_events","type":"User","site_admin":false},"body":"@jeffposnick @beaufortfrancois \r\n\r\nThis reduces the workload on scroll events by only looking at the features below the container's scrollTop. The milestone is selected in the left nav iff a new label is scroll passed. The perf gain isn't much now, but it will be when we get more and more features","created_at":"2015-08-04T17:03:11Z","updated_at":"2015-08-04T17:23:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"061fd5d45a4775fa13a744fa662909093e7e0df2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/pulls/228/commits","review_comments_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/pulls/228/comments","review_comment_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/issues/228/comments","statuses_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/statuses/64ada4ab32c9057145414adba8c5a9ed87617a5d","head":{"label":"GoogleChrome:scrollperf","ref":"scrollperf","sha":"64ada4ab32c9057145414adba8c5a9ed87617a5d","user":{"login":"GoogleChrome","id":1778935,"avatar_url":"https://avatars.githubusercontent.com/u/1778935?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleChrome","html_url":"https://github.com/GoogleChrome","followers_url":"https://api.github.com/users/GoogleChrome/followers","following_url":"https://api.github.com/users/GoogleChrome/following{/other_user}","gists_url":"https://api.github.com/users/GoogleChrome/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleChrome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleChrome/subscriptions","organizations_url":"https://api.github.com/users/GoogleChrome/orgs","repos_url":"https://api.github.com/users/GoogleChrome/repos","events_url":"https://api.github.com/users/GoogleChrome/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleChrome/received_events","type":"Organization","site_admin":false},"repo":{"id":8633551,"name":"chromium-dashboard","full_name":"GoogleChrome/chromium-dashboard","owner":{"login":"GoogleChrome","id":1778935,"avatar_url":"https://avatars.githubusercontent.com/u/1778935?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleChrome","html_url":"https://github.com/GoogleChrome","followers_url":"https://api.github.com/users/GoogleChrome/followers","following_url":"https://api.github.com/users/GoogleChrome/following{/other_user}","gists_url":"https://api.github.com/users/GoogleChrome/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleChrome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleChrome/subscriptions","organizations_url":"https://api.github.com/users/GoogleChrome/orgs","repos_url":"https://api.github.com/users/GoogleChrome/repos","events_url":"https://api.github.com/users/GoogleChrome/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleChrome/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleChrome/chromium-dashboard","description":"Chromium Dashboard","fork":false,"url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard","forks_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/forks","keys_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/teams","hooks_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/hooks","issue_events_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/events","assignees_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/tags","blobs_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/languages","stargazers_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/stargazers","contributors_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/contributors","subscribers_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/subscribers","subscription_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/subscription","commits_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/merges","archive_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/downloads","issues_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/labels{/name}","releases_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/releases{/id}","created_at":"2013-03-07T18:18:10Z","updated_at":"2015-08-04T00:30:16Z","pushed_at":"2015-08-04T17:04:57Z","git_url":"git://github.com/GoogleChrome/chromium-dashboard.git","ssh_url":"git@github.com:GoogleChrome/chromium-dashboard.git","clone_url":"https://github.com/GoogleChrome/chromium-dashboard.git","svn_url":"https://github.com/GoogleChrome/chromium-dashboard","homepage":"https://www.chromestatus.com","size":6484,"stargazers_count":129,"watchers_count":129,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":89,"mirror_url":null,"open_issues_count":40,"forks":89,"open_issues":40,"watchers":129,"default_branch":"master"}},"base":{"label":"GoogleChrome:master","ref":"master","sha":"860318a85c32775426ce3f6792e813d9317e4511","user":{"login":"GoogleChrome","id":1778935,"avatar_url":"https://avatars.githubusercontent.com/u/1778935?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleChrome","html_url":"https://github.com/GoogleChrome","followers_url":"https://api.github.com/users/GoogleChrome/followers","following_url":"https://api.github.com/users/GoogleChrome/following{/other_user}","gists_url":"https://api.github.com/users/GoogleChrome/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleChrome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleChrome/subscriptions","organizations_url":"https://api.github.com/users/GoogleChrome/orgs","repos_url":"https://api.github.com/users/GoogleChrome/repos","events_url":"https://api.github.com/users/GoogleChrome/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleChrome/received_events","type":"Organization","site_admin":false},"repo":{"id":8633551,"name":"chromium-dashboard","full_name":"GoogleChrome/chromium-dashboard","owner":{"login":"GoogleChrome","id":1778935,"avatar_url":"https://avatars.githubusercontent.com/u/1778935?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleChrome","html_url":"https://github.com/GoogleChrome","followers_url":"https://api.github.com/users/GoogleChrome/followers","following_url":"https://api.github.com/users/GoogleChrome/following{/other_user}","gists_url":"https://api.github.com/users/GoogleChrome/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleChrome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleChrome/subscriptions","organizations_url":"https://api.github.com/users/GoogleChrome/orgs","repos_url":"https://api.github.com/users/GoogleChrome/repos","events_url":"https://api.github.com/users/GoogleChrome/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleChrome/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleChrome/chromium-dashboard","description":"Chromium Dashboard","fork":false,"url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard","forks_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/forks","keys_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/teams","hooks_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/hooks","issue_events_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/events","assignees_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/tags","blobs_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/languages","stargazers_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/stargazers","contributors_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/contributors","subscribers_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/subscribers","subscription_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/subscription","commits_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/merges","archive_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/downloads","issues_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/labels{/name}","releases_url":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/releases{/id}","created_at":"2013-03-07T18:18:10Z","updated_at":"2015-08-04T00:30:16Z","pushed_at":"2015-08-04T17:04:57Z","git_url":"git://github.com/GoogleChrome/chromium-dashboard.git","ssh_url":"git@github.com:GoogleChrome/chromium-dashboard.git","clone_url":"https://github.com/GoogleChrome/chromium-dashboard.git","svn_url":"https://github.com/GoogleChrome/chromium-dashboard","homepage":"https://www.chromestatus.com","size":6484,"stargazers_count":129,"watchers_count":129,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":89,"mirror_url":null,"open_issues_count":40,"forks":89,"open_issues":40,"watchers":129,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/pulls/228"},"html":{"href":"https://github.com/GoogleChrome/chromium-dashboard/pull/228"},"issue":{"href":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/issues/228"},"comments":{"href":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/issues/228/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/pulls/228/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/pulls/228/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleChrome/chromium-dashboard/statuses/64ada4ab32c9057145414adba8c5a9ed87617a5d"}}}}