{"action":"created","issue":{"url":"https://api.github.com/repos/servo/servo/issues/16014","repository_url":"https://api.github.com/repos/servo/servo","labels_url":"https://api.github.com/repos/servo/servo/issues/16014/labels{/name}","comments_url":"https://api.github.com/repos/servo/servo/issues/16014/comments","events_url":"https://api.github.com/repos/servo/servo/issues/16014/events","html_url":"https://github.com/servo/servo/pull/16014","id":215156586,"number":16014,"title":"Per-process lock for CSSOM objects","user":{"login":"SimonSapin","id":291359,"avatar_url":"https://avatars3.githubusercontent.com/u/291359?v=3","gravatar_id":"","url":"https://api.github.com/users/SimonSapin","html_url":"https://github.com/SimonSapin","followers_url":"https://api.github.com/users/SimonSapin/followers","following_url":"https://api.github.com/users/SimonSapin/following{/other_user}","gists_url":"https://api.github.com/users/SimonSapin/gists{/gist_id}","starred_url":"https://api.github.com/users/SimonSapin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimonSapin/subscriptions","organizations_url":"https://api.github.com/users/SimonSapin/orgs","repos_url":"https://api.github.com/users/SimonSapin/repos","events_url":"https://api.github.com/users/SimonSapin/events{/privacy}","received_events_url":"https://api.github.com/users/SimonSapin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"bholley","id":377435,"avatar_url":"https://avatars2.githubusercontent.com/u/377435?v=3","gravatar_id":"","url":"https://api.github.com/users/bholley","html_url":"https://github.com/bholley","followers_url":"https://api.github.com/users/bholley/followers","following_url":"https://api.github.com/users/bholley/following{/other_user}","gists_url":"https://api.github.com/users/bholley/gists{/gist_id}","starred_url":"https://api.github.com/users/bholley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bholley/subscriptions","organizations_url":"https://api.github.com/users/bholley/orgs","repos_url":"https://api.github.com/users/bholley/repos","events_url":"https://api.github.com/users/bholley/events{/privacy}","received_events_url":"https://api.github.com/users/bholley/received_events","type":"User","site_admin":false},"assignees":[{"login":"bholley","id":377435,"avatar_url":"https://avatars2.githubusercontent.com/u/377435?v=3","gravatar_id":"","url":"https://api.github.com/users/bholley","html_url":"https://github.com/bholley","followers_url":"https://api.github.com/users/bholley/followers","following_url":"https://api.github.com/users/bholley/following{/other_user}","gists_url":"https://api.github.com/users/bholley/gists{/gist_id}","starred_url":"https://api.github.com/users/bholley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bholley/subscriptions","organizations_url":"https://api.github.com/users/bholley/orgs","repos_url":"https://api.github.com/users/bholley/repos","events_url":"https://api.github.com/users/bholley/events{/privacy}","received_events_url":"https://api.github.com/users/bholley/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2017-03-18T01:22:24Z","updated_at":"2017-03-18T01:22:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/servo/servo/pulls/16014","html_url":"https://github.com/servo/servo/pull/16014","diff_url":"https://github.com/servo/servo/pull/16014.diff","patch_url":"https://github.com/servo/servo/pull/16014.patch"},"body":"<!-- Please describe your changes on the following line: -->\r\n\r\nBefore this PR, every object reflected in CSSOM is in `Arc<RwLock<_>>` to enable safe (synchronized) mutable aliasing. Acquiring all these locks has significant cost during selector matching:\r\n\r\n* https://bugzilla.mozilla.org/show_bug.cgi?id=1311469\r\n* https://bugzilla.mozilla.org/show_bug.cgi?id=1335941\r\n* https://bugzilla.mozilla.org/show_bug.cgi?id=1339703\r\n\r\nThis PR introduce a mechanism to protect many objects with the same `RwLock` that only needs to be acquired once.\r\n\r\nIn Stylo, there is one such lock per process (in a `lazy_static`), used for everything.\r\n\r\nI non-Stylo Servo, I originally intended to have one such lock per document (for author-origin stylesheets, and one per process for user-agent and user sytlesheets since they’re shared across documents, and never mutated anyway). However I failed to have the same document-specific (or pipeline-specific) `Arc` reachable from both `Document` nodes and `LayoutThread`. Recursively following callers lead me to include this `Arc` in `UnprivilegedPipelineContent`, but that needs to be serializable. So there is a second process-wide lock.\r\n\r\nThis was previously #15998, closed accidentally.\r\n\r\n---\r\n<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->\r\n- [x] `./mach build -d` does not report any errors\r\n- [x] `./mach test-tidy` does not report any errors\r\n- [ ] These changes fix #__ (github issue number if applicable).\r\n\r\n<!-- Either: -->\r\n- [ ] There are tests for these changes OR\r\n- [ ] These changes do not require tests because _____\r\n\r\n<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->\r\n"},"comment":{"url":"https://api.github.com/repos/servo/servo/issues/comments/287506582","html_url":"https://github.com/servo/servo/pull/16014#issuecomment-287506582","issue_url":"https://api.github.com/repos/servo/servo/issues/16014","id":287506582,"user":{"login":"bors-servo","id":4368172,"avatar_url":"https://avatars2.githubusercontent.com/u/4368172?v=3","gravatar_id":"","url":"https://api.github.com/users/bors-servo","html_url":"https://github.com/bors-servo","followers_url":"https://api.github.com/users/bors-servo/followers","following_url":"https://api.github.com/users/bors-servo/following{/other_user}","gists_url":"https://api.github.com/users/bors-servo/gists{/gist_id}","starred_url":"https://api.github.com/users/bors-servo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bors-servo/subscriptions","organizations_url":"https://api.github.com/users/bors-servo/orgs","repos_url":"https://api.github.com/users/bors-servo/repos","events_url":"https://api.github.com/users/bors-servo/events{/privacy}","received_events_url":"https://api.github.com/users/bors-servo/received_events","type":"User","site_admin":false},"created_at":"2017-03-18T01:22:50Z","updated_at":"2017-03-18T01:22:50Z","body":":hourglass: Trying commit c0def16580cb9ddfe8264a44b4c71d12b23b4361 with merge 913166160c02c991d3fbf810afd6ef86bfe257bd..."}}
{"actor":{"display_login":"bors-servo"}}