{"action":"created","comment":{"url":"https://api.github.com/repos/servo/servo/pulls/comments/26809310","id":26809310,"diff_hunk":"@@ -4829,3 +4852,12 @@ pub fn longhands_from_shorthand(shorthand: &str) -> Option<Vec<String>> {\n         _ => None,\n     }\n }\n+\n+fn compute_font_hash(font: &mut style_structs::Font) {","path":"components/style/properties.mako.rs","position":155,"original_position":155,"commit_id":"9da961ccdfa35f70652288450dd7d8f2e68fcb85","original_commit_id":"9da961ccdfa35f70652288450dd7d8f2e68fcb85","user":{"login":"glennw","id":2350882,"avatar_url":"https://avatars.githubusercontent.com/u/2350882?v=3","gravatar_id":"","url":"https://api.github.com/users/glennw","html_url":"https://github.com/glennw","followers_url":"https://api.github.com/users/glennw/followers","following_url":"https://api.github.com/users/glennw/following{/other_user}","gists_url":"https://api.github.com/users/glennw/gists{/gist_id}","starred_url":"https://api.github.com/users/glennw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glennw/subscriptions","organizations_url":"https://api.github.com/users/glennw/orgs","repos_url":"https://api.github.com/users/glennw/repos","events_url":"https://api.github.com/users/glennw/events{/privacy}","received_events_url":"https://api.github.com/users/glennw/received_events","type":"User","site_admin":false},"body":"True - perhaps a comment in the font code to update that hash function if that ever changes? Otherwise, looks good to me.\r\n","created_at":"2015-03-19T23:53:33Z","updated_at":"2015-03-19T23:53:33Z","html_url":"https://github.com/servo/servo/pull/5278#discussion_r26809310","pull_request_url":"https://api.github.com/repos/servo/servo/pulls/5278","_links":{"self":{"href":"https://api.github.com/repos/servo/servo/pulls/comments/26809310"},"html":{"href":"https://github.com/servo/servo/pull/5278#discussion_r26809310"},"pull_request":{"href":"https://api.github.com/repos/servo/servo/pulls/5278"}}},"pull_request":{"url":"https://api.github.com/repos/servo/servo/pulls/5278","id":31545097,"html_url":"https://github.com/servo/servo/pull/5278","diff_url":"https://github.com/servo/servo/pull/5278.diff","patch_url":"https://github.com/servo/servo/pull/5278.patch","issue_url":"https://api.github.com/repos/servo/servo/issues/5278","number":5278,"state":"open","locked":false,"title":"gfx: Perform more aggressive caching in `FontContext::get_layout_font_group_for_style()`.","user":{"login":"pcwalton","id":157897,"avatar_url":"https://avatars.githubusercontent.com/u/157897?v=3","gravatar_id":"","url":"https://api.github.com/users/pcwalton","html_url":"https://github.com/pcwalton","followers_url":"https://api.github.com/users/pcwalton/followers","following_url":"https://api.github.com/users/pcwalton/following{/other_user}","gists_url":"https://api.github.com/users/pcwalton/gists{/gist_id}","starred_url":"https://api.github.com/users/pcwalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcwalton/subscriptions","organizations_url":"https://api.github.com/users/pcwalton/orgs","repos_url":"https://api.github.com/users/pcwalton/repos","events_url":"https://api.github.com/users/pcwalton/events{/privacy}","received_events_url":"https://api.github.com/users/pcwalton/received_events","type":"User","site_admin":false},"body":"There are several optimizations here:\r\n\r\n* We make font families atoms, to allow for quicker comparisons.\r\n\r\n* We precalculate an FNV hash of the relevant fields of the font style\r\n  structure.\r\n\r\n* When obtaining a platform font group, we first check pointer equality\r\n  for the font style. If there's no match, we go to the FNV hash. Only\r\n  if both caches miss do we construct and cache a font group. Note that\r\n  individual fonts are *also* cached; thus there are two layers of\r\n  caching here.\r\n\r\n15% improvement in total layout thread time for Facebook Timeline.\r\n\r\nr? @glennw (since you last worked on `get_layout_font_group_for_style()` IIRC)","created_at":"2015-03-19T17:17:06Z","updated_at":"2015-03-19T23:53:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3a40703390bd10f6349ca9da0be5955a43dc193d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/servo/servo/pulls/5278/commits","review_comments_url":"https://api.github.com/repos/servo/servo/pulls/5278/comments","review_comment_url":"https://api.github.com/repos/servo/servo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/servo/servo/issues/5278/comments","statuses_url":"https://api.github.com/repos/servo/servo/statuses/9da961ccdfa35f70652288450dd7d8f2e68fcb85","head":{"label":"pcwalton:font-group-caching","ref":"font-group-caching","sha":"9da961ccdfa35f70652288450dd7d8f2e68fcb85","user":{"login":"pcwalton","id":157897,"avatar_url":"https://avatars.githubusercontent.com/u/157897?v=3","gravatar_id":"","url":"https://api.github.com/users/pcwalton","html_url":"https://github.com/pcwalton","followers_url":"https://api.github.com/users/pcwalton/followers","following_url":"https://api.github.com/users/pcwalton/following{/other_user}","gists_url":"https://api.github.com/users/pcwalton/gists{/gist_id}","starred_url":"https://api.github.com/users/pcwalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcwalton/subscriptions","organizations_url":"https://api.github.com/users/pcwalton/orgs","repos_url":"https://api.github.com/users/pcwalton/repos","events_url":"https://api.github.com/users/pcwalton/events{/privacy}","received_events_url":"https://api.github.com/users/pcwalton/received_events","type":"User","site_admin":false},"repo":{"id":9251720,"name":"servo","full_name":"pcwalton/servo","owner":{"login":"pcwalton","id":157897,"avatar_url":"https://avatars.githubusercontent.com/u/157897?v=3","gravatar_id":"","url":"https://api.github.com/users/pcwalton","html_url":"https://github.com/pcwalton","followers_url":"https://api.github.com/users/pcwalton/followers","following_url":"https://api.github.com/users/pcwalton/following{/other_user}","gists_url":"https://api.github.com/users/pcwalton/gists{/gist_id}","starred_url":"https://api.github.com/users/pcwalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcwalton/subscriptions","organizations_url":"https://api.github.com/users/pcwalton/orgs","repos_url":"https://api.github.com/users/pcwalton/repos","events_url":"https://api.github.com/users/pcwalton/events{/privacy}","received_events_url":"https://api.github.com/users/pcwalton/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pcwalton/servo","description":"The Servo Browser Engine","fork":true,"url":"https://api.github.com/repos/pcwalton/servo","forks_url":"https://api.github.com/repos/pcwalton/servo/forks","keys_url":"https://api.github.com/repos/pcwalton/servo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pcwalton/servo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pcwalton/servo/teams","hooks_url":"https://api.github.com/repos/pcwalton/servo/hooks","issue_events_url":"https://api.github.com/repos/pcwalton/servo/issues/events{/number}","events_url":"https://api.github.com/repos/pcwalton/servo/events","assignees_url":"https://api.github.com/repos/pcwalton/servo/assignees{/user}","branches_url":"https://api.github.com/repos/pcwalton/servo/branches{/branch}","tags_url":"https://api.github.com/repos/pcwalton/servo/tags","blobs_url":"https://api.github.com/repos/pcwalton/servo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pcwalton/servo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pcwalton/servo/git/refs{/sha}","trees_url":"https://api.github.com/repos/pcwalton/servo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pcwalton/servo/statuses/{sha}","languages_url":"https://api.github.com/repos/pcwalton/servo/languages","stargazers_url":"https://api.github.com/repos/pcwalton/servo/stargazers","contributors_url":"https://api.github.com/repos/pcwalton/servo/contributors","subscribers_url":"https://api.github.com/repos/pcwalton/servo/subscribers","subscription_url":"https://api.github.com/repos/pcwalton/servo/subscription","commits_url":"https://api.github.com/repos/pcwalton/servo/commits{/sha}","git_commits_url":"https://api.github.com/repos/pcwalton/servo/git/commits{/sha}","comments_url":"https://api.github.com/repos/pcwalton/servo/comments{/number}","issue_comment_url":"https://api.github.com/repos/pcwalton/servo/issues/comments{/number}","contents_url":"https://api.github.com/repos/pcwalton/servo/contents/{+path}","compare_url":"https://api.github.com/repos/pcwalton/servo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pcwalton/servo/merges","archive_url":"https://api.github.com/repos/pcwalton/servo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pcwalton/servo/downloads","issues_url":"https://api.github.com/repos/pcwalton/servo/issues{/number}","pulls_url":"https://api.github.com/repos/pcwalton/servo/pulls{/number}","milestones_url":"https://api.github.com/repos/pcwalton/servo/milestones{/number}","notifications_url":"https://api.github.com/repos/pcwalton/servo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pcwalton/servo/labels{/name}","releases_url":"https://api.github.com/repos/pcwalton/servo/releases{/id}","created_at":"2013-04-05T22:11:24Z","updated_at":"2014-07-22T08:38:24Z","pushed_at":"2015-03-19T22:06:50Z","git_url":"git://github.com/pcwalton/servo.git","ssh_url":"git@github.com:pcwalton/servo.git","clone_url":"https://github.com/pcwalton/servo.git","svn_url":"https://github.com/pcwalton/servo","homepage":"","size":53632,"stargazers_count":2,"watchers_count":2,"language":"Rust","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":2,"default_branch":"master"}},"base":{"label":"servo:master","ref":"master","sha":"4863eb65e9419d4b89834c7d1ad068eabfa05641","user":{"login":"servo","id":2566135,"avatar_url":"https://avatars.githubusercontent.com/u/2566135?v=3","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":3390243,"name":"servo","full_name":"servo/servo","owner":{"login":"servo","id":2566135,"avatar_url":"https://avatars.githubusercontent.com/u/2566135?v=3","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/servo","description":"The Servo Browser Engine","fork":false,"url":"https://api.github.com/repos/servo/servo","forks_url":"https://api.github.com/repos/servo/servo/forks","keys_url":"https://api.github.com/repos/servo/servo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/servo/servo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/servo/servo/teams","hooks_url":"https://api.github.com/repos/servo/servo/hooks","issue_events_url":"https://api.github.com/repos/servo/servo/issues/events{/number}","events_url":"https://api.github.com/repos/servo/servo/events","assignees_url":"https://api.github.com/repos/servo/servo/assignees{/user}","branches_url":"https://api.github.com/repos/servo/servo/branches{/branch}","tags_url":"https://api.github.com/repos/servo/servo/tags","blobs_url":"https://api.github.com/repos/servo/servo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/servo/servo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/servo/servo/git/refs{/sha}","trees_url":"https://api.github.com/repos/servo/servo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/servo/servo/statuses/{sha}","languages_url":"https://api.github.com/repos/servo/servo/languages","stargazers_url":"https://api.github.com/repos/servo/servo/stargazers","contributors_url":"https://api.github.com/repos/servo/servo/contributors","subscribers_url":"https://api.github.com/repos/servo/servo/subscribers","subscription_url":"https://api.github.com/repos/servo/servo/subscription","commits_url":"https://api.github.com/repos/servo/servo/commits{/sha}","git_commits_url":"https://api.github.com/repos/servo/servo/git/commits{/sha}","comments_url":"https://api.github.com/repos/servo/servo/comments{/number}","issue_comment_url":"https://api.github.com/repos/servo/servo/issues/comments{/number}","contents_url":"https://api.github.com/repos/servo/servo/contents/{+path}","compare_url":"https://api.github.com/repos/servo/servo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/servo/servo/merges","archive_url":"https://api.github.com/repos/servo/servo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/servo/servo/downloads","issues_url":"https://api.github.com/repos/servo/servo/issues{/number}","pulls_url":"https://api.github.com/repos/servo/servo/pulls{/number}","milestones_url":"https://api.github.com/repos/servo/servo/milestones{/number}","notifications_url":"https://api.github.com/repos/servo/servo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/servo/servo/labels{/name}","releases_url":"https://api.github.com/repos/servo/servo/releases{/id}","created_at":"2012-02-08T19:07:25Z","updated_at":"2015-03-19T22:06:50Z","pushed_at":"2015-03-19T23:33:48Z","git_url":"git://github.com/servo/servo.git","ssh_url":"git@github.com:servo/servo.git","clone_url":"https://github.com/servo/servo.git","svn_url":"https://github.com/servo/servo","homepage":"","size":100279,"stargazers_count":3332,"watchers_count":3332,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":555,"mirror_url":null,"open_issues_count":777,"forks":555,"open_issues":777,"watchers":3332,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/servo/servo/pulls/5278"},"html":{"href":"https://github.com/servo/servo/pull/5278"},"issue":{"href":"https://api.github.com/repos/servo/servo/issues/5278"},"comments":{"href":"https://api.github.com/repos/servo/servo/issues/5278/comments"},"review_comments":{"href":"https://api.github.com/repos/servo/servo/pulls/5278/comments"},"review_comment":{"href":"https://api.github.com/repos/servo/servo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/servo/servo/pulls/5278/commits"},"statuses":{"href":"https://api.github.com/repos/servo/servo/statuses/9da961ccdfa35f70652288450dd7d8f2e68fcb85"}}}}