{"action":"created","issue":{"url":"https://api.github.com/repos/servo/servo/issues/6359","labels_url":"https://api.github.com/repos/servo/servo/issues/6359/labels{/name}","comments_url":"https://api.github.com/repos/servo/servo/issues/6359/comments","events_url":"https://api.github.com/repos/servo/servo/issues/6359/events","html_url":"https://github.com/servo/servo/issues/6359","id":87812129,"number":6359,"title":"Cache the ID in a field on Element to optimize TElement::get_id.","user":{"login":"Ms2ger","id":111161,"avatar_url":"https://avatars.githubusercontent.com/u/111161?v=3","gravatar_id":"","url":"https://api.github.com/users/Ms2ger","html_url":"https://github.com/Ms2ger","followers_url":"https://api.github.com/users/Ms2ger/followers","following_url":"https://api.github.com/users/Ms2ger/following{/other_user}","gists_url":"https://api.github.com/users/Ms2ger/gists{/gist_id}","starred_url":"https://api.github.com/users/Ms2ger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ms2ger/subscriptions","organizations_url":"https://api.github.com/users/Ms2ger/orgs","repos_url":"https://api.github.com/users/Ms2ger/repos","events_url":"https://api.github.com/users/Ms2ger/events{/privacy}","received_events_url":"https://api.github.com/users/Ms2ger/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/servo/servo/labels/A-content/dom","name":"A-content/dom","color":"d7e102"},{"url":"https://api.github.com/repos/servo/servo/labels/E-easy","name":"E-easy","color":"02e10c"},{"url":"https://api.github.com/repos/servo/servo/labels/I-perf-slow","name":"I-perf-slow","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-06-12T18:27:06Z","updated_at":"2015-06-21T15:15:05Z","closed_at":null,"body":"Right now, we loop over all the attributes, which is probably too slow.\r\n\r\nCode is in `components/script/dom/element.rs`."},"comment":{"url":"https://api.github.com/repos/servo/servo/issues/comments/113912642","html_url":"https://github.com/servo/servo/issues/6359#issuecomment-113912642","issue_url":"https://api.github.com/repos/servo/servo/issues/6359","id":113912642,"user":{"login":"jdm","id":27658,"avatar_url":"https://avatars.githubusercontent.com/u/27658?v=3","gravatar_id":"","url":"https://api.github.com/users/jdm","html_url":"https://github.com/jdm","followers_url":"https://api.github.com/users/jdm/followers","following_url":"https://api.github.com/users/jdm/following{/other_user}","gists_url":"https://api.github.com/users/jdm/gists{/gist_id}","starred_url":"https://api.github.com/users/jdm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdm/subscriptions","organizations_url":"https://api.github.com/users/jdm/orgs","repos_url":"https://api.github.com/users/jdm/repos","events_url":"https://api.github.com/users/jdm/events{/privacy}","received_events_url":"https://api.github.com/users/jdm/received_events","type":"User","site_admin":false},"created_at":"2015-06-21T15:15:05Z","updated_at":"2015-06-21T15:15:05Z","body":"Whenever a page has `<foo id=\"bar\">`, we add an element to the vector of attributes in `Element`. When evaluating CSS selectors like `#bar`, we need to quickly retrieve any id attribute from each element that is checked. Currently we perform a linear search over the attributes (see http://mxr.mozilla.org/servo/source/components/layout/wrapper.rs#587 and http://mxr.mozilla.org/servo/source/components/script/dom/element.rs#234)."}}