{"action":"created","comment":{"url":"https://api.github.com/repos/servo/webrender/pulls/comments/204601227","pull_request_review_id":139709128,"id":204601227,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDYwMTIyNw==","diff_hunk":"@@ -56,8 +56,8 @@ pub struct ClipIdToIndexMapper {\n \n impl ClipIdToIndexMapper {\n     pub fn add_clip_chain(&mut self, id: ClipId, index: ClipChainIndex) {\n-        debug_assert!(!self.clip_chain_map.contains_key(&id));\n-        self.clip_chain_map.insert(id, index);\n+        let _is_new_key = self.clip_chain_map.insert(id, index).is_none();","path":"webrender/src/display_list_flattener.rs","position":71,"original_position":6,"commit_id":"87bddf92c36c8742bc8f03a944ff8a8124b47597","original_commit_id":"87bddf92c36c8742bc8f03a944ff8a8124b47597","user":{"login":"kvark","id":107301,"node_id":"MDQ6VXNlcjEwNzMwMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/107301?v=4","gravatar_id":"","url":"https://api.github.com/users/kvark","html_url":"https://github.com/kvark","followers_url":"https://api.github.com/users/kvark/followers","following_url":"https://api.github.com/users/kvark/following{/other_user}","gists_url":"https://api.github.com/users/kvark/gists{/gist_id}","starred_url":"https://api.github.com/users/kvark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kvark/subscriptions","organizations_url":"https://api.github.com/users/kvark/orgs","repos_url":"https://api.github.com/users/kvark/repos","events_url":"https://api.github.com/users/kvark/events{/privacy}","received_events_url":"https://api.github.com/users/kvark/received_events","type":"User","site_admin":false},"body":"nit: let's not confuse the reader with `is_none()` here and instead move it inside the assert","created_at":"2018-07-24T01:36:51Z","updated_at":"2018-07-24T01:36:56Z","html_url":"https://github.com/servo/webrender/pull/2925#discussion_r204601227","pull_request_url":"https://api.github.com/repos/servo/webrender/pulls/2925","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/servo/webrender/pulls/comments/204601227"},"html":{"href":"https://github.com/servo/webrender/pull/2925#discussion_r204601227"},"pull_request":{"href":"https://api.github.com/repos/servo/webrender/pulls/2925"}}},"pull_request":{"url":"https://api.github.com/repos/servo/webrender/pulls/2925","id":203092945,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzMDkyOTQ1","html_url":"https://github.com/servo/webrender/pull/2925","diff_url":"https://github.com/servo/webrender/pull/2925.diff","patch_url":"https://github.com/servo/webrender/pull/2925.patch","issue_url":"https://api.github.com/repos/servo/webrender/issues/2925","number":2925,"state":"open","locked":false,"title":"Simplify the ClipId -> CST id mapping code.","user":{"login":"gw3583","id":39062770,"node_id":"MDQ6VXNlcjM5MDYyNzcw","avatar_url":"https://avatars0.githubusercontent.com/u/39062770?v=4","gravatar_id":"","url":"https://api.github.com/users/gw3583","html_url":"https://github.com/gw3583","followers_url":"https://api.github.com/users/gw3583/followers","following_url":"https://api.github.com/users/gw3583/following{/other_user}","gists_url":"https://api.github.com/users/gw3583/gists{/gist_id}","starred_url":"https://api.github.com/users/gw3583/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gw3583/subscriptions","organizations_url":"https://api.github.com/users/gw3583/orgs","repos_url":"https://api.github.com/users/gw3583/repos","events_url":"https://api.github.com/users/gw3583/events{/privacy}","received_events_url":"https://api.github.com/users/gw3583/received_events","type":"User","site_admin":false},"body":"There are some upcoming changes which will modify how and when\r\nwe store and represent clip nodes and chains. These changes are\r\nnecessary to allow WR to rasterize pictures in a different coordinate\r\nspace than just screen space.\r\n\r\nThis patch simplifies the mapping of ClipId to array indices in\r\nthe clip-scroll tree. This will make it simpler to make the\r\nchanges discussed above - specifically, we can unify how we handle\r\nclip nodes with the per-primitive complex clips.\r\n\r\nThe code this removes was a performance optimization to avoid\r\nhashmap lookups. I did some profiling on a number of real world\r\nsites and also on some gecko layer stress tests, and didn't find\r\nany noticeable regression from simplifying this code. However,\r\nonce the work above has been completed, we could re-investigate\r\nhow to optimize this mapping process, if it ever shows up in a\r\nprofile.\r\n\r\nIn one of the stress tests [1] for spatial and clip node creation,\r\nthe code is now slightly faster with this patch (28ms vs 29ms).\r\n\r\n[1] https://mattwoodrow.github.io/dl-test/dl-test.html?count=50000&layer=inactive\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/servo/webrender/2925)\n<!-- Reviewable:end -->\n","created_at":"2018-07-23T02:10:15Z","updated_at":"2018-07-24T01:36:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a7a212af3ea2908117b8ff33ad4ddbd735cfe20a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/servo/webrender/pulls/2925/commits","review_comments_url":"https://api.github.com/repos/servo/webrender/pulls/2925/comments","review_comment_url":"https://api.github.com/repos/servo/webrender/pulls/comments{/number}","comments_url":"https://api.github.com/repos/servo/webrender/issues/2925/comments","statuses_url":"https://api.github.com/repos/servo/webrender/statuses/87bddf92c36c8742bc8f03a944ff8a8124b47597","head":{"label":"gw3583:map2","ref":"map2","sha":"87bddf92c36c8742bc8f03a944ff8a8124b47597","user":{"login":"gw3583","id":39062770,"node_id":"MDQ6VXNlcjM5MDYyNzcw","avatar_url":"https://avatars0.githubusercontent.com/u/39062770?v=4","gravatar_id":"","url":"https://api.github.com/users/gw3583","html_url":"https://github.com/gw3583","followers_url":"https://api.github.com/users/gw3583/followers","following_url":"https://api.github.com/users/gw3583/following{/other_user}","gists_url":"https://api.github.com/users/gw3583/gists{/gist_id}","starred_url":"https://api.github.com/users/gw3583/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gw3583/subscriptions","organizations_url":"https://api.github.com/users/gw3583/orgs","repos_url":"https://api.github.com/users/gw3583/repos","events_url":"https://api.github.com/users/gw3583/events{/privacy}","received_events_url":"https://api.github.com/users/gw3583/received_events","type":"User","site_admin":false},"repo":{"id":132623937,"node_id":"MDEwOlJlcG9zaXRvcnkxMzI2MjM5Mzc=","name":"webrender","full_name":"gw3583/webrender","owner":{"login":"gw3583","id":39062770,"node_id":"MDQ6VXNlcjM5MDYyNzcw","avatar_url":"https://avatars0.githubusercontent.com/u/39062770?v=4","gravatar_id":"","url":"https://api.github.com/users/gw3583","html_url":"https://github.com/gw3583","followers_url":"https://api.github.com/users/gw3583/followers","following_url":"https://api.github.com/users/gw3583/following{/other_user}","gists_url":"https://api.github.com/users/gw3583/gists{/gist_id}","starred_url":"https://api.github.com/users/gw3583/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gw3583/subscriptions","organizations_url":"https://api.github.com/users/gw3583/orgs","repos_url":"https://api.github.com/users/gw3583/repos","events_url":"https://api.github.com/users/gw3583/events{/privacy}","received_events_url":"https://api.github.com/users/gw3583/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gw3583/webrender","description":"A GPU-based renderer for the web","fork":true,"url":"https://api.github.com/repos/gw3583/webrender","forks_url":"https://api.github.com/repos/gw3583/webrender/forks","keys_url":"https://api.github.com/repos/gw3583/webrender/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gw3583/webrender/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gw3583/webrender/teams","hooks_url":"https://api.github.com/repos/gw3583/webrender/hooks","issue_events_url":"https://api.github.com/repos/gw3583/webrender/issues/events{/number}","events_url":"https://api.github.com/repos/gw3583/webrender/events","assignees_url":"https://api.github.com/repos/gw3583/webrender/assignees{/user}","branches_url":"https://api.github.com/repos/gw3583/webrender/branches{/branch}","tags_url":"https://api.github.com/repos/gw3583/webrender/tags","blobs_url":"https://api.github.com/repos/gw3583/webrender/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gw3583/webrender/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gw3583/webrender/git/refs{/sha}","trees_url":"https://api.github.com/repos/gw3583/webrender/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gw3583/webrender/statuses/{sha}","languages_url":"https://api.github.com/repos/gw3583/webrender/languages","stargazers_url":"https://api.github.com/repos/gw3583/webrender/stargazers","contributors_url":"https://api.github.com/repos/gw3583/webrender/contributors","subscribers_url":"https://api.github.com/repos/gw3583/webrender/subscribers","subscription_url":"https://api.github.com/repos/gw3583/webrender/subscription","commits_url":"https://api.github.com/repos/gw3583/webrender/commits{/sha}","git_commits_url":"https://api.github.com/repos/gw3583/webrender/git/commits{/sha}","comments_url":"https://api.github.com/repos/gw3583/webrender/comments{/number}","issue_comment_url":"https://api.github.com/repos/gw3583/webrender/issues/comments{/number}","contents_url":"https://api.github.com/repos/gw3583/webrender/contents/{+path}","compare_url":"https://api.github.com/repos/gw3583/webrender/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gw3583/webrender/merges","archive_url":"https://api.github.com/repos/gw3583/webrender/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gw3583/webrender/downloads","issues_url":"https://api.github.com/repos/gw3583/webrender/issues{/number}","pulls_url":"https://api.github.com/repos/gw3583/webrender/pulls{/number}","milestones_url":"https://api.github.com/repos/gw3583/webrender/milestones{/number}","notifications_url":"https://api.github.com/repos/gw3583/webrender/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gw3583/webrender/labels{/name}","releases_url":"https://api.github.com/repos/gw3583/webrender/releases{/id}","deployments_url":"https://api.github.com/repos/gw3583/webrender/deployments","created_at":"2018-05-08T14:50:17Z","updated_at":"2018-05-08T14:50:20Z","pushed_at":"2018-07-24T01:32:57Z","git_url":"git://github.com/gw3583/webrender.git","ssh_url":"git@github.com:gw3583/webrender.git","clone_url":"https://github.com/gw3583/webrender.git","svn_url":"https://github.com/gw3583/webrender","homepage":"https://doc.servo.org/webrender/","size":28021,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"servo:master","ref":"master","sha":"c3b9939bd5bf03ca1a0faf5f667f27fd5cab0f2f","user":{"login":"servo","id":2566135,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1NjYxMzU=","avatar_url":"https://avatars1.githubusercontent.com/u/2566135?v=4","gravatar_id":"","url":"https://api.github.com/users/servo","html_url":"https://github.com/servo","followers_url":"https://api.github.com/users/servo/followers","following_url":"https://api.github.com/users/servo/following{/other_user}","gists_url":"https://api.github.com/users/servo/gists{/gist_id}","starred_url":"https://api.github.com/users/servo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/servo/subscriptions","organizations_url":"https://api.github.com/users/servo/orgs","repos_url":"https://api.github.com/users/servo/repos","events_url":"https://api.github.com/users/servo/events{/privacy}","received_events_url":"https://api.github.com/users/servo/received_events","type":"Organization","site_admin":false},"repo":{"id":42894575,"node_id":"MDEwOlJlcG9zaXRvcnk0Mjg5NDU3NQ==","name":"webrender","full_name":"servo/webrender","owner":{"login":"servo","id":2566135,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1NjYxMzU=","avatar_url":"https://avatars1.githubusercontent.com/u/2566135?v=4","gravatar_id":"","url":"https://api.github.com/users/servo","html_url":"https://github.com/servo","followers_url":"https://api.github.com/users/servo/followers","following_url":"https://api.github.com/users/servo/following{/other_user}","gists_url":"https://api.github.com/users/servo/gists{/gist_id}","starred_url":"https://api.github.com/users/servo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/servo/subscriptions","organizations_url":"https://api.github.com/users/servo/orgs","repos_url":"https://api.github.com/users/servo/repos","events_url":"https://api.github.com/users/servo/events{/privacy}","received_events_url":"https://api.github.com/users/servo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/servo/webrender","description":"A GPU-based renderer for the web","fork":false,"url":"https://api.github.com/repos/servo/webrender","forks_url":"https://api.github.com/repos/servo/webrender/forks","keys_url":"https://api.github.com/repos/servo/webrender/keys{/key_id}","collaborators_url":"https://api.github.com/repos/servo/webrender/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/servo/webrender/teams","hooks_url":"https://api.github.com/repos/servo/webrender/hooks","issue_events_url":"https://api.github.com/repos/servo/webrender/issues/events{/number}","events_url":"https://api.github.com/repos/servo/webrender/events","assignees_url":"https://api.github.com/repos/servo/webrender/assignees{/user}","branches_url":"https://api.github.com/repos/servo/webrender/branches{/branch}","tags_url":"https://api.github.com/repos/servo/webrender/tags","blobs_url":"https://api.github.com/repos/servo/webrender/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/servo/webrender/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/servo/webrender/git/refs{/sha}","trees_url":"https://api.github.com/repos/servo/webrender/git/trees{/sha}","statuses_url":"https://api.github.com/repos/servo/webrender/statuses/{sha}","languages_url":"https://api.github.com/repos/servo/webrender/languages","stargazers_url":"https://api.github.com/repos/servo/webrender/stargazers","contributors_url":"https://api.github.com/repos/servo/webrender/contributors","subscribers_url":"https://api.github.com/repos/servo/webrender/subscribers","subscription_url":"https://api.github.com/repos/servo/webrender/subscription","commits_url":"https://api.github.com/repos/servo/webrender/commits{/sha}","git_commits_url":"https://api.github.com/repos/servo/webrender/git/commits{/sha}","comments_url":"https://api.github.com/repos/servo/webrender/comments{/number}","issue_comment_url":"https://api.github.com/repos/servo/webrender/issues/comments{/number}","contents_url":"https://api.github.com/repos/servo/webrender/contents/{+path}","compare_url":"https://api.github.com/repos/servo/webrender/compare/{base}...{head}","merges_url":"https://api.github.com/repos/servo/webrender/merges","archive_url":"https://api.github.com/repos/servo/webrender/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/servo/webrender/downloads","issues_url":"https://api.github.com/repos/servo/webrender/issues{/number}","pulls_url":"https://api.github.com/repos/servo/webrender/pulls{/number}","milestones_url":"https://api.github.com/repos/servo/webrender/milestones{/number}","notifications_url":"https://api.github.com/repos/servo/webrender/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/servo/webrender/labels{/name}","releases_url":"https://api.github.com/repos/servo/webrender/releases{/id}","deployments_url":"https://api.github.com/repos/servo/webrender/deployments","created_at":"2015-09-21T21:27:30Z","updated_at":"2018-07-24T00:47:45Z","pushed_at":"2018-07-24T01:33:12Z","git_url":"git://github.com/servo/webrender.git","ssh_url":"git@github.com:servo/webrender.git","clone_url":"https://github.com/servo/webrender.git","svn_url":"https://github.com/servo/webrender","homepage":"https://doc.servo.org/webrender/","size":31817,"stargazers_count":1138,"watchers_count":1138,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":170,"mirror_url":null,"archived":false,"open_issues_count":195,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":170,"open_issues":195,"watchers":1138,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/servo/webrender/pulls/2925"},"html":{"href":"https://github.com/servo/webrender/pull/2925"},"issue":{"href":"https://api.github.com/repos/servo/webrender/issues/2925"},"comments":{"href":"https://api.github.com/repos/servo/webrender/issues/2925/comments"},"review_comments":{"href":"https://api.github.com/repos/servo/webrender/pulls/2925/comments"},"review_comment":{"href":"https://api.github.com/repos/servo/webrender/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/servo/webrender/pulls/2925/commits"},"statuses":{"href":"https://api.github.com/repos/servo/webrender/statuses/87bddf92c36c8742bc8f03a944ff8a8124b47597"}},"author_association":"NONE"}}
{"actor":{"display_login":"kvark"}}