{"action":"created","comment":{"url":"https://api.github.com/repos/paulmillr/es6-shim/pulls/comments/47658732","id":47658732,"diff_hunk":"@@ -291,6 +291,13 @@\n       return x != null && Object(x) === x;\n     },\n \n+    TypeIsNotObject: function (val) {\n+      // This is faster when TypeIsObject may commonly return false.\n+      return val === void 0 || val === null || val === true || val === false ||","path":"es6-shim.js","position":20,"original_position":20,"commit_id":"33ec9b4272bdcfe2ac82381a618e674187458f75","original_commit_id":"33ec9b4272bdcfe2ac82381a618e674187458f75","user":{"login":"cscott","id":156080,"avatar_url":"https://avatars.githubusercontent.com/u/156080?v=3","gravatar_id":"","url":"https://api.github.com/users/cscott","html_url":"https://github.com/cscott","followers_url":"https://api.github.com/users/cscott/followers","following_url":"https://api.github.com/users/cscott/following{/other_user}","gists_url":"https://api.github.com/users/cscott/gists{/gist_id}","starred_url":"https://api.github.com/users/cscott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cscott/subscriptions","organizations_url":"https://api.github.com/users/cscott/orgs","repos_url":"https://api.github.com/users/cscott/repos","events_url":"https://api.github.com/users/cscott/events{/privacy}","received_events_url":"https://api.github.com/users/cscott/received_events","type":"User","site_admin":false},"body":"`val == null` is actually slower than an explicit test against `null` and `undefined`, when you look at v8's optimized assembly output.  The form shown here was pretty extensively benchmarked.  It might look a little weird, but it's pretty straightforward to read (a plus) and happens to be the fastest option.","created_at":"2015-12-15T16:19:08Z","updated_at":"2015-12-15T16:19:08Z","html_url":"https://github.com/paulmillr/es6-shim/pull/383#discussion_r47658732","pull_request_url":"https://api.github.com/repos/paulmillr/es6-shim/pulls/383","_links":{"self":{"href":"https://api.github.com/repos/paulmillr/es6-shim/pulls/comments/47658732"},"html":{"href":"https://github.com/paulmillr/es6-shim/pull/383#discussion_r47658732"},"pull_request":{"href":"https://api.github.com/repos/paulmillr/es6-shim/pulls/383"}}},"pull_request":{"url":"https://api.github.com/repos/paulmillr/es6-shim/pulls/383","id":53488544,"html_url":"https://github.com/paulmillr/es6-shim/pull/383","diff_url":"https://github.com/paulmillr/es6-shim/pull/383.diff","patch_url":"https://github.com/paulmillr/es6-shim/pull/383.patch","issue_url":"https://api.github.com/repos/paulmillr/es6-shim/issues/383","number":383,"state":"open","locked":false,"title":"Improve performance of Promises","user":{"login":"cscott","id":156080,"avatar_url":"https://avatars.githubusercontent.com/u/156080?v=3","gravatar_id":"","url":"https://api.github.com/users/cscott","html_url":"https://github.com/cscott","followers_url":"https://api.github.com/users/cscott/followers","following_url":"https://api.github.com/users/cscott/following{/other_user}","gists_url":"https://api.github.com/users/cscott/gists{/gist_id}","starred_url":"https://api.github.com/users/cscott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cscott/subscriptions","organizations_url":"https://api.github.com/users/cscott/orgs","repos_url":"https://api.github.com/users/cscott/repos","events_url":"https://api.github.com/users/cscott/events{/privacy}","received_events_url":"https://api.github.com/users/cscott/received_events","type":"User","site_admin":false},"body":"These patches improve the performance of Promises by roughly a factor of 2x, resulting in performance on the `doxbee sequential` benchmark equivalent to the `core-js` Promise implementation and within a factor of two of v8's native Promise implementation.  It also results in about 50% less memory usage on that benchmark than either `core-js` or v8 native Promises.\r\n\r\nThe improvements to TypeIsObject and IsCallable also improve the performance of other parts of the shims.","created_at":"2015-12-12T23:35:19Z","updated_at":"2015-12-15T16:19:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"59639efab3d55795a3180d08a9b0d4f093ec474e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/paulmillr/es6-shim/pulls/383/commits","review_comments_url":"https://api.github.com/repos/paulmillr/es6-shim/pulls/383/comments","review_comment_url":"https://api.github.com/repos/paulmillr/es6-shim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/paulmillr/es6-shim/issues/383/comments","statuses_url":"https://api.github.com/repos/paulmillr/es6-shim/statuses/33ec9b4272bdcfe2ac82381a618e674187458f75","head":{"label":"cscott:promise-performance-2","ref":"promise-performance-2","sha":"33ec9b4272bdcfe2ac82381a618e674187458f75","user":{"login":"cscott","id":156080,"avatar_url":"https://avatars.githubusercontent.com/u/156080?v=3","gravatar_id":"","url":"https://api.github.com/users/cscott","html_url":"https://github.com/cscott","followers_url":"https://api.github.com/users/cscott/followers","following_url":"https://api.github.com/users/cscott/following{/other_user}","gists_url":"https://api.github.com/users/cscott/gists{/gist_id}","starred_url":"https://api.github.com/users/cscott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cscott/subscriptions","organizations_url":"https://api.github.com/users/cscott/orgs","repos_url":"https://api.github.com/users/cscott/repos","events_url":"https://api.github.com/users/cscott/events{/privacy}","received_events_url":"https://api.github.com/users/cscott/received_events","type":"User","site_admin":false},"repo":{"id":13394431,"name":"es6-shim","full_name":"cscott/es6-shim","owner":{"login":"cscott","id":156080,"avatar_url":"https://avatars.githubusercontent.com/u/156080?v=3","gravatar_id":"","url":"https://api.github.com/users/cscott","html_url":"https://github.com/cscott","followers_url":"https://api.github.com/users/cscott/followers","following_url":"https://api.github.com/users/cscott/following{/other_user}","gists_url":"https://api.github.com/users/cscott/gists{/gist_id}","starred_url":"https://api.github.com/users/cscott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cscott/subscriptions","organizations_url":"https://api.github.com/users/cscott/orgs","repos_url":"https://api.github.com/users/cscott/repos","events_url":"https://api.github.com/users/cscott/events{/privacy}","received_events_url":"https://api.github.com/users/cscott/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cscott/es6-shim","description":"ECMAScript 6 (Harmony) compatibility shims for legacy JavaScript engines","fork":true,"url":"https://api.github.com/repos/cscott/es6-shim","forks_url":"https://api.github.com/repos/cscott/es6-shim/forks","keys_url":"https://api.github.com/repos/cscott/es6-shim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cscott/es6-shim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cscott/es6-shim/teams","hooks_url":"https://api.github.com/repos/cscott/es6-shim/hooks","issue_events_url":"https://api.github.com/repos/cscott/es6-shim/issues/events{/number}","events_url":"https://api.github.com/repos/cscott/es6-shim/events","assignees_url":"https://api.github.com/repos/cscott/es6-shim/assignees{/user}","branches_url":"https://api.github.com/repos/cscott/es6-shim/branches{/branch}","tags_url":"https://api.github.com/repos/cscott/es6-shim/tags","blobs_url":"https://api.github.com/repos/cscott/es6-shim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cscott/es6-shim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cscott/es6-shim/git/refs{/sha}","trees_url":"https://api.github.com/repos/cscott/es6-shim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cscott/es6-shim/statuses/{sha}","languages_url":"https://api.github.com/repos/cscott/es6-shim/languages","stargazers_url":"https://api.github.com/repos/cscott/es6-shim/stargazers","contributors_url":"https://api.github.com/repos/cscott/es6-shim/contributors","subscribers_url":"https://api.github.com/repos/cscott/es6-shim/subscribers","subscription_url":"https://api.github.com/repos/cscott/es6-shim/subscription","commits_url":"https://api.github.com/repos/cscott/es6-shim/commits{/sha}","git_commits_url":"https://api.github.com/repos/cscott/es6-shim/git/commits{/sha}","comments_url":"https://api.github.com/repos/cscott/es6-shim/comments{/number}","issue_comment_url":"https://api.github.com/repos/cscott/es6-shim/issues/comments{/number}","contents_url":"https://api.github.com/repos/cscott/es6-shim/contents/{+path}","compare_url":"https://api.github.com/repos/cscott/es6-shim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cscott/es6-shim/merges","archive_url":"https://api.github.com/repos/cscott/es6-shim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cscott/es6-shim/downloads","issues_url":"https://api.github.com/repos/cscott/es6-shim/issues{/number}","pulls_url":"https://api.github.com/repos/cscott/es6-shim/pulls{/number}","milestones_url":"https://api.github.com/repos/cscott/es6-shim/milestones{/number}","notifications_url":"https://api.github.com/repos/cscott/es6-shim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cscott/es6-shim/labels{/name}","releases_url":"https://api.github.com/repos/cscott/es6-shim/releases{/id}","created_at":"2013-10-07T20:09:34Z","updated_at":"2014-06-04T18:01:22Z","pushed_at":"2015-12-12T23:36:26Z","git_url":"git://github.com/cscott/es6-shim.git","ssh_url":"git@github.com:cscott/es6-shim.git","clone_url":"https://github.com/cscott/es6-shim.git","svn_url":"https://github.com/cscott/es6-shim","homepage":"http://paulmillr.com","size":3210,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"testling-cscott"}},"base":{"label":"paulmillr:master","ref":"master","sha":"20d978ac90a39e06b6821758e388c1618639b973","user":{"login":"paulmillr","id":574696,"avatar_url":"https://avatars.githubusercontent.com/u/574696?v=3","gravatar_id":"","url":"https://api.github.com/users/paulmillr","html_url":"https://github.com/paulmillr","followers_url":"https://api.github.com/users/paulmillr/followers","following_url":"https://api.github.com/users/paulmillr/following{/other_user}","gists_url":"https://api.github.com/users/paulmillr/gists{/gist_id}","starred_url":"https://api.github.com/users/paulmillr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulmillr/subscriptions","organizations_url":"https://api.github.com/users/paulmillr/orgs","repos_url":"https://api.github.com/users/paulmillr/repos","events_url":"https://api.github.com/users/paulmillr/events{/privacy}","received_events_url":"https://api.github.com/users/paulmillr/received_events","type":"User","site_admin":false},"repo":{"id":3046507,"name":"es6-shim","full_name":"paulmillr/es6-shim","owner":{"login":"paulmillr","id":574696,"avatar_url":"https://avatars.githubusercontent.com/u/574696?v=3","gravatar_id":"","url":"https://api.github.com/users/paulmillr","html_url":"https://github.com/paulmillr","followers_url":"https://api.github.com/users/paulmillr/followers","following_url":"https://api.github.com/users/paulmillr/following{/other_user}","gists_url":"https://api.github.com/users/paulmillr/gists{/gist_id}","starred_url":"https://api.github.com/users/paulmillr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulmillr/subscriptions","organizations_url":"https://api.github.com/users/paulmillr/orgs","repos_url":"https://api.github.com/users/paulmillr/repos","events_url":"https://api.github.com/users/paulmillr/events{/privacy}","received_events_url":"https://api.github.com/users/paulmillr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/paulmillr/es6-shim","description":"ECMAScript 6 compatibility shims for legacy JavaScript engines","fork":false,"url":"https://api.github.com/repos/paulmillr/es6-shim","forks_url":"https://api.github.com/repos/paulmillr/es6-shim/forks","keys_url":"https://api.github.com/repos/paulmillr/es6-shim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paulmillr/es6-shim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paulmillr/es6-shim/teams","hooks_url":"https://api.github.com/repos/paulmillr/es6-shim/hooks","issue_events_url":"https://api.github.com/repos/paulmillr/es6-shim/issues/events{/number}","events_url":"https://api.github.com/repos/paulmillr/es6-shim/events","assignees_url":"https://api.github.com/repos/paulmillr/es6-shim/assignees{/user}","branches_url":"https://api.github.com/repos/paulmillr/es6-shim/branches{/branch}","tags_url":"https://api.github.com/repos/paulmillr/es6-shim/tags","blobs_url":"https://api.github.com/repos/paulmillr/es6-shim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paulmillr/es6-shim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paulmillr/es6-shim/git/refs{/sha}","trees_url":"https://api.github.com/repos/paulmillr/es6-shim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paulmillr/es6-shim/statuses/{sha}","languages_url":"https://api.github.com/repos/paulmillr/es6-shim/languages","stargazers_url":"https://api.github.com/repos/paulmillr/es6-shim/stargazers","contributors_url":"https://api.github.com/repos/paulmillr/es6-shim/contributors","subscribers_url":"https://api.github.com/repos/paulmillr/es6-shim/subscribers","subscription_url":"https://api.github.com/repos/paulmillr/es6-shim/subscription","commits_url":"https://api.github.com/repos/paulmillr/es6-shim/commits{/sha}","git_commits_url":"https://api.github.com/repos/paulmillr/es6-shim/git/commits{/sha}","comments_url":"https://api.github.com/repos/paulmillr/es6-shim/comments{/number}","issue_comment_url":"https://api.github.com/repos/paulmillr/es6-shim/issues/comments{/number}","contents_url":"https://api.github.com/repos/paulmillr/es6-shim/contents/{+path}","compare_url":"https://api.github.com/repos/paulmillr/es6-shim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paulmillr/es6-shim/merges","archive_url":"https://api.github.com/repos/paulmillr/es6-shim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paulmillr/es6-shim/downloads","issues_url":"https://api.github.com/repos/paulmillr/es6-shim/issues{/number}","pulls_url":"https://api.github.com/repos/paulmillr/es6-shim/pulls{/number}","milestones_url":"https://api.github.com/repos/paulmillr/es6-shim/milestones{/number}","notifications_url":"https://api.github.com/repos/paulmillr/es6-shim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paulmillr/es6-shim/labels{/name}","releases_url":"https://api.github.com/repos/paulmillr/es6-shim/releases{/id}","created_at":"2011-12-25T00:29:07Z","updated_at":"2015-12-15T11:17:26Z","pushed_at":"2015-12-15T01:20:50Z","git_url":"git://github.com/paulmillr/es6-shim.git","ssh_url":"git@github.com:paulmillr/es6-shim.git","clone_url":"https://github.com/paulmillr/es6-shim.git","svn_url":"https://github.com/paulmillr/es6-shim","homepage":"http://paulmillr.com","size":3709,"stargazers_count":1478,"watchers_count":1478,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":141,"mirror_url":null,"open_issues_count":26,"forks":141,"open_issues":26,"watchers":1478,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/paulmillr/es6-shim/pulls/383"},"html":{"href":"https://github.com/paulmillr/es6-shim/pull/383"},"issue":{"href":"https://api.github.com/repos/paulmillr/es6-shim/issues/383"},"comments":{"href":"https://api.github.com/repos/paulmillr/es6-shim/issues/383/comments"},"review_comments":{"href":"https://api.github.com/repos/paulmillr/es6-shim/pulls/383/comments"},"review_comment":{"href":"https://api.github.com/repos/paulmillr/es6-shim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/paulmillr/es6-shim/pulls/383/commits"},"statuses":{"href":"https://api.github.com/repos/paulmillr/es6-shim/statuses/33ec9b4272bdcfe2ac82381a618e674187458f75"}}}}