{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/css-layout/pulls/comments/41102585","id":41102585,"diff_hunk":"@@ -1122,8 +1122,50 @@ var computeLayout = (function() {\n       child.nextAbsoluteChild = null;\n     }\n   }\n+  \n+  function layoutNode(node, parentMaxWidth, parentDirection) {\n+    if (node.isDirty ||","path":"src/Layout.js","position":24,"original_position":24,"commit_id":"57d41f3e353e4b149449b058b978571fc3350079","original_commit_id":"57d41f3e353e4b149449b058b978571fc3350079","user":{"login":"vjeux","id":197597,"avatar_url":"https://avatars.githubusercontent.com/u/197597?v=3","gravatar_id":"","url":"https://api.github.com/users/vjeux","html_url":"https://github.com/vjeux","followers_url":"https://api.github.com/users/vjeux/followers","following_url":"https://api.github.com/users/vjeux/following{/other_user}","gists_url":"https://api.github.com/users/vjeux/gists{/gist_id}","starred_url":"https://api.github.com/users/vjeux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vjeux/subscriptions","organizations_url":"https://api.github.com/users/vjeux/orgs","repos_url":"https://api.github.com/users/vjeux/repos","events_url":"https://api.github.com/users/vjeux/events{/privacy}","received_events_url":"https://api.github.com/users/vjeux/received_events","type":"User","site_admin":false},"body":"Can you write this as a local variable skipLayout the same way the C version does it?","created_at":"2015-10-04T21:23:48Z","updated_at":"2015-10-04T21:23:48Z","html_url":"https://github.com/facebook/css-layout/pull/138#discussion_r41102585","pull_request_url":"https://api.github.com/repos/facebook/css-layout/pulls/138","_links":{"self":{"href":"https://api.github.com/repos/facebook/css-layout/pulls/comments/41102585"},"html":{"href":"https://github.com/facebook/css-layout/pull/138#discussion_r41102585"},"pull_request":{"href":"https://api.github.com/repos/facebook/css-layout/pulls/138"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/css-layout/pulls/138","id":46730495,"html_url":"https://github.com/facebook/css-layout/pull/138","diff_url":"https://github.com/facebook/css-layout/pull/138.diff","patch_url":"https://github.com/facebook/css-layout/pull/138.patch","issue_url":"https://api.github.com/repos/facebook/css-layout/issues/138","number":138,"state":"open","locked":false,"title":"Implement caching in the JS version","user":{"login":"devongovett","id":19409,"avatar_url":"https://avatars.githubusercontent.com/u/19409?v=3","gravatar_id":"","url":"https://api.github.com/users/devongovett","html_url":"https://github.com/devongovett","followers_url":"https://api.github.com/users/devongovett/followers","following_url":"https://api.github.com/users/devongovett/following{/other_user}","gists_url":"https://api.github.com/users/devongovett/gists{/gist_id}","starred_url":"https://api.github.com/users/devongovett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devongovett/subscriptions","organizations_url":"https://api.github.com/users/devongovett/orgs","repos_url":"https://api.github.com/users/devongovett/repos","events_url":"https://api.github.com/users/devongovett/events{/privacy}","received_events_url":"https://api.github.com/users/devongovett/received_events","type":"User","site_admin":false},"body":"This implements caching for the JS version, as suggested by @vjeux in #137. Here's the results of the same benchmark I used before, compared to the current master (after my previous optimizations):\r\n\r\n```\r\nnew x 270 ops/sec ±122.16% (94 runs sampled)\r\nold x 22.76 ops/sec ±4.21% (43 runs sampled)\r\nnew is the fastest\r\nold is 92% slower\r\n```","created_at":"2015-10-04T18:52:34Z","updated_at":"2015-10-04T21:23:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5e8dd5efeb440595e403527157d481f4a15a4eeb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/facebook/css-layout/pulls/138/commits","review_comments_url":"https://api.github.com/repos/facebook/css-layout/pulls/138/comments","review_comment_url":"https://api.github.com/repos/facebook/css-layout/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/css-layout/issues/138/comments","statuses_url":"https://api.github.com/repos/facebook/css-layout/statuses/57d41f3e353e4b149449b058b978571fc3350079","head":{"label":"devongovett:js-caching","ref":"js-caching","sha":"57d41f3e353e4b149449b058b978571fc3350079","user":{"login":"devongovett","id":19409,"avatar_url":"https://avatars.githubusercontent.com/u/19409?v=3","gravatar_id":"","url":"https://api.github.com/users/devongovett","html_url":"https://github.com/devongovett","followers_url":"https://api.github.com/users/devongovett/followers","following_url":"https://api.github.com/users/devongovett/following{/other_user}","gists_url":"https://api.github.com/users/devongovett/gists{/gist_id}","starred_url":"https://api.github.com/users/devongovett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devongovett/subscriptions","organizations_url":"https://api.github.com/users/devongovett/orgs","repos_url":"https://api.github.com/users/devongovett/repos","events_url":"https://api.github.com/users/devongovett/events{/privacy}","received_events_url":"https://api.github.com/users/devongovett/received_events","type":"User","site_admin":false},"repo":{"id":43627190,"name":"css-layout","full_name":"devongovett/css-layout","owner":{"login":"devongovett","id":19409,"avatar_url":"https://avatars.githubusercontent.com/u/19409?v=3","gravatar_id":"","url":"https://api.github.com/users/devongovett","html_url":"https://github.com/devongovett","followers_url":"https://api.github.com/users/devongovett/followers","following_url":"https://api.github.com/users/devongovett/following{/other_user}","gists_url":"https://api.github.com/users/devongovett/gists{/gist_id}","starred_url":"https://api.github.com/users/devongovett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devongovett/subscriptions","organizations_url":"https://api.github.com/users/devongovett/orgs","repos_url":"https://api.github.com/users/devongovett/repos","events_url":"https://api.github.com/users/devongovett/events{/privacy}","received_events_url":"https://api.github.com/users/devongovett/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/devongovett/css-layout","description":"Reimplementation of CSS layout using pure JavaScript","fork":true,"url":"https://api.github.com/repos/devongovett/css-layout","forks_url":"https://api.github.com/repos/devongovett/css-layout/forks","keys_url":"https://api.github.com/repos/devongovett/css-layout/keys{/key_id}","collaborators_url":"https://api.github.com/repos/devongovett/css-layout/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/devongovett/css-layout/teams","hooks_url":"https://api.github.com/repos/devongovett/css-layout/hooks","issue_events_url":"https://api.github.com/repos/devongovett/css-layout/issues/events{/number}","events_url":"https://api.github.com/repos/devongovett/css-layout/events","assignees_url":"https://api.github.com/repos/devongovett/css-layout/assignees{/user}","branches_url":"https://api.github.com/repos/devongovett/css-layout/branches{/branch}","tags_url":"https://api.github.com/repos/devongovett/css-layout/tags","blobs_url":"https://api.github.com/repos/devongovett/css-layout/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/devongovett/css-layout/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/devongovett/css-layout/git/refs{/sha}","trees_url":"https://api.github.com/repos/devongovett/css-layout/git/trees{/sha}","statuses_url":"https://api.github.com/repos/devongovett/css-layout/statuses/{sha}","languages_url":"https://api.github.com/repos/devongovett/css-layout/languages","stargazers_url":"https://api.github.com/repos/devongovett/css-layout/stargazers","contributors_url":"https://api.github.com/repos/devongovett/css-layout/contributors","subscribers_url":"https://api.github.com/repos/devongovett/css-layout/subscribers","subscription_url":"https://api.github.com/repos/devongovett/css-layout/subscription","commits_url":"https://api.github.com/repos/devongovett/css-layout/commits{/sha}","git_commits_url":"https://api.github.com/repos/devongovett/css-layout/git/commits{/sha}","comments_url":"https://api.github.com/repos/devongovett/css-layout/comments{/number}","issue_comment_url":"https://api.github.com/repos/devongovett/css-layout/issues/comments{/number}","contents_url":"https://api.github.com/repos/devongovett/css-layout/contents/{+path}","compare_url":"https://api.github.com/repos/devongovett/css-layout/compare/{base}...{head}","merges_url":"https://api.github.com/repos/devongovett/css-layout/merges","archive_url":"https://api.github.com/repos/devongovett/css-layout/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/devongovett/css-layout/downloads","issues_url":"https://api.github.com/repos/devongovett/css-layout/issues{/number}","pulls_url":"https://api.github.com/repos/devongovett/css-layout/pulls{/number}","milestones_url":"https://api.github.com/repos/devongovett/css-layout/milestones{/number}","notifications_url":"https://api.github.com/repos/devongovett/css-layout/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/devongovett/css-layout/labels{/name}","releases_url":"https://api.github.com/repos/devongovett/css-layout/releases{/id}","created_at":"2015-10-04T06:19:13Z","updated_at":"2015-10-04T06:19:14Z","pushed_at":"2015-10-04T21:19:08Z","git_url":"git://github.com/devongovett/css-layout.git","ssh_url":"git@github.com:devongovett/css-layout.git","clone_url":"https://github.com/devongovett/css-layout.git","svn_url":"https://github.com/devongovett/css-layout","homepage":null,"size":3008,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"3042bac0bbd54af27f144ab6ec0910f0206e4fa5","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":18503721,"name":"css-layout","full_name":"facebook/css-layout","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/css-layout","description":"Reimplementation of CSS layout using pure JavaScript","fork":false,"url":"https://api.github.com/repos/facebook/css-layout","forks_url":"https://api.github.com/repos/facebook/css-layout/forks","keys_url":"https://api.github.com/repos/facebook/css-layout/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/css-layout/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/css-layout/teams","hooks_url":"https://api.github.com/repos/facebook/css-layout/hooks","issue_events_url":"https://api.github.com/repos/facebook/css-layout/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/css-layout/events","assignees_url":"https://api.github.com/repos/facebook/css-layout/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/css-layout/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/css-layout/tags","blobs_url":"https://api.github.com/repos/facebook/css-layout/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/css-layout/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/css-layout/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/css-layout/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/css-layout/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/css-layout/languages","stargazers_url":"https://api.github.com/repos/facebook/css-layout/stargazers","contributors_url":"https://api.github.com/repos/facebook/css-layout/contributors","subscribers_url":"https://api.github.com/repos/facebook/css-layout/subscribers","subscription_url":"https://api.github.com/repos/facebook/css-layout/subscription","commits_url":"https://api.github.com/repos/facebook/css-layout/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/css-layout/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/css-layout/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/css-layout/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/css-layout/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/css-layout/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/css-layout/merges","archive_url":"https://api.github.com/repos/facebook/css-layout/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/css-layout/downloads","issues_url":"https://api.github.com/repos/facebook/css-layout/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/css-layout/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/css-layout/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/css-layout/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/css-layout/labels{/name}","releases_url":"https://api.github.com/repos/facebook/css-layout/releases{/id}","created_at":"2014-04-07T01:37:37Z","updated_at":"2015-10-04T15:31:49Z","pushed_at":"2015-10-04T21:19:09Z","git_url":"git://github.com/facebook/css-layout.git","ssh_url":"git@github.com:facebook/css-layout.git","clone_url":"https://github.com/facebook/css-layout.git","svn_url":"https://github.com/facebook/css-layout","homepage":null,"size":3008,"stargazers_count":2955,"watchers_count":2955,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":141,"mirror_url":null,"open_issues_count":15,"forks":141,"open_issues":15,"watchers":2955,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/css-layout/pulls/138"},"html":{"href":"https://github.com/facebook/css-layout/pull/138"},"issue":{"href":"https://api.github.com/repos/facebook/css-layout/issues/138"},"comments":{"href":"https://api.github.com/repos/facebook/css-layout/issues/138/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/css-layout/pulls/138/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/css-layout/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/css-layout/pulls/138/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/css-layout/statuses/57d41f3e353e4b149449b058b978571fc3350079"}}}}