{"action":"created","comment":{"url":"https://api.github.com/repos/ReactiveX/RxJS/pulls/comments/51361214","id":51361214,"diff_hunk":"@@ -18,22 +16,21 @@ export function every<T>(predicate: (value: T, index: number, source: Observable\n                          thisArg?: any): Observable<boolean> {\n   const source = this;\n   if (source._isScalar) {\n-    const result: boolean = tryCatch(predicate).call(thisArg || this, source.value, 0, source);\n-    if (result === errorObject) {\n-      return new ErrorObservable(errorObject.e, source.scheduler);\n-    } else {\n+    try {","path":"src/operator/every.ts","position":17,"original_position":17,"commit_id":"959a596986c6032636bcfdfd39616c3c77435d84","original_commit_id":"959a596986c6032636bcfdfd39616c3c77435d84","user":{"login":"luisgabriel","id":553804,"avatar_url":"https://avatars.githubusercontent.com/u/553804?v=3","gravatar_id":"","url":"https://api.github.com/users/luisgabriel","html_url":"https://github.com/luisgabriel","followers_url":"https://api.github.com/users/luisgabriel/followers","following_url":"https://api.github.com/users/luisgabriel/following{/other_user}","gists_url":"https://api.github.com/users/luisgabriel/gists{/gist_id}","starred_url":"https://api.github.com/users/luisgabriel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luisgabriel/subscriptions","organizations_url":"https://api.github.com/users/luisgabriel/orgs","repos_url":"https://api.github.com/users/luisgabriel/repos","events_url":"https://api.github.com/users/luisgabriel/events{/privacy}","received_events_url":"https://api.github.com/users/luisgabriel/received_events","type":"User","site_admin":false},"body":"In this operator, we have performance improvement only for the common case (non-scalar/array). Both Removing `tryCatch()` from the particular cases only, and removing it plus moving the try/catch block to separate functions changes almost nothing in terms of performance. \r\n\r\nWhat should we do in cases such as this one? Remove the tryCatch() anyway or leave as it is now?","created_at":"2016-01-31T14:36:39Z","updated_at":"2016-01-31T14:36:39Z","html_url":"https://github.com/ReactiveX/RxJS/pull/1266#discussion_r51361214","pull_request_url":"https://api.github.com/repos/ReactiveX/RxJS/pulls/1266","_links":{"self":{"href":"https://api.github.com/repos/ReactiveX/RxJS/pulls/comments/51361214"},"html":{"href":"https://github.com/ReactiveX/RxJS/pull/1266#discussion_r51361214"},"pull_request":{"href":"https://api.github.com/repos/ReactiveX/RxJS/pulls/1266"}}},"pull_request":{"url":"https://api.github.com/repos/ReactiveX/RxJS/pulls/1266","id":57685046,"html_url":"https://github.com/ReactiveX/RxJS/pull/1266","diff_url":"https://github.com/ReactiveX/RxJS/pull/1266.diff","patch_url":"https://github.com/ReactiveX/RxJS/pull/1266.patch","issue_url":"https://api.github.com/repos/ReactiveX/RxJS/issues/1266","number":1266,"state":"open","locked":false,"title":"perf(every): remove tryCatch/errorObject (~1.5x improvement)","user":{"login":"luisgabriel","id":553804,"avatar_url":"https://avatars.githubusercontent.com/u/553804?v=3","gravatar_id":"","url":"https://api.github.com/users/luisgabriel","html_url":"https://github.com/luisgabriel","followers_url":"https://api.github.com/users/luisgabriel/followers","following_url":"https://api.github.com/users/luisgabriel/following{/other_user}","gists_url":"https://api.github.com/users/luisgabriel/gists{/gist_id}","starred_url":"https://api.github.com/users/luisgabriel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luisgabriel/subscriptions","organizations_url":"https://api.github.com/users/luisgabriel/orgs","repos_url":"https://api.github.com/users/luisgabriel/repos","events_url":"https://api.github.com/users/luisgabriel/events{/privacy}","received_events_url":"https://api.github.com/users/luisgabriel/received_events","type":"User","site_admin":false},"body":"Before:\r\n```\r\n                                   |       RxJS 4.0.7 |  RxJS 5.0.0-beta.1 | factor | % improved\r\n--------------------------------------------------------------------------------------------------\r\n every-predicate-array - immediate |  95,665 (±1.63%) | 1,707,222 (±0.25%) | 17.85x |   1,684.6%\r\nevery-predicate-scalar - immediate | 110,190 (±3.14%) | 1,676,966 (±0.59%) | 15.22x |   1,421.9%\r\n  every-predicate-this - immediate |  40,100 (±0.37%) |   161,021 (±0.24%) |  4.02x |     301.6%\r\n       every-predicate - immediate |  39,217 (±1.82%) |   166,973 (±0.46%) |  4.26x |     325.8%\r\n```\r\n\r\nAfter:\r\n```\r\n                                   |       RxJS 4.0.7 |  RxJS 5.0.0-beta.1 | factor | % improved\r\n--------------------------------------------------------------------------------------------------\r\n every-predicate-array - immediate |  98,913 (±1.28%) | 1,752,222 (±1.30%) | 17.71x |   1,671.5%\r\nevery-predicate-scalar - immediate | 112,000 (±0.83%) | 1,652,837 (±0.99%) | 14.76x |   1,375.7%\r\n  every-predicate-this - immediate |  39,521 (±0.69%) |   322,943 (±0.80%) |  8.17x |     717.1%\r\n       every-predicate - immediate |  43,363 (±2.19%) |   293,080 (±0.52%) |  6.76x |     575.9%\r\n```","created_at":"2016-01-29T18:36:07Z","updated_at":"2016-01-31T14:36:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cb9b0f327a537befce39ef54b0124fa7e77a7bc8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ReactiveX/RxJS/pulls/1266/commits","review_comments_url":"https://api.github.com/repos/ReactiveX/RxJS/pulls/1266/comments","review_comment_url":"https://api.github.com/repos/ReactiveX/RxJS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ReactiveX/RxJS/issues/1266/comments","statuses_url":"https://api.github.com/repos/ReactiveX/RxJS/statuses/959a596986c6032636bcfdfd39616c3c77435d84","head":{"label":"luisgabriel:perf-every","ref":"perf-every","sha":"959a596986c6032636bcfdfd39616c3c77435d84","user":{"login":"luisgabriel","id":553804,"avatar_url":"https://avatars.githubusercontent.com/u/553804?v=3","gravatar_id":"","url":"https://api.github.com/users/luisgabriel","html_url":"https://github.com/luisgabriel","followers_url":"https://api.github.com/users/luisgabriel/followers","following_url":"https://api.github.com/users/luisgabriel/following{/other_user}","gists_url":"https://api.github.com/users/luisgabriel/gists{/gist_id}","starred_url":"https://api.github.com/users/luisgabriel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luisgabriel/subscriptions","organizations_url":"https://api.github.com/users/luisgabriel/orgs","repos_url":"https://api.github.com/users/luisgabriel/repos","events_url":"https://api.github.com/users/luisgabriel/events{/privacy}","received_events_url":"https://api.github.com/users/luisgabriel/received_events","type":"User","site_admin":false},"repo":{"id":43468563,"name":"RxJS","full_name":"luisgabriel/RxJS","owner":{"login":"luisgabriel","id":553804,"avatar_url":"https://avatars.githubusercontent.com/u/553804?v=3","gravatar_id":"","url":"https://api.github.com/users/luisgabriel","html_url":"https://github.com/luisgabriel","followers_url":"https://api.github.com/users/luisgabriel/followers","following_url":"https://api.github.com/users/luisgabriel/following{/other_user}","gists_url":"https://api.github.com/users/luisgabriel/gists{/gist_id}","starred_url":"https://api.github.com/users/luisgabriel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luisgabriel/subscriptions","organizations_url":"https://api.github.com/users/luisgabriel/orgs","repos_url":"https://api.github.com/users/luisgabriel/repos","events_url":"https://api.github.com/users/luisgabriel/events{/privacy}","received_events_url":"https://api.github.com/users/luisgabriel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/luisgabriel/RxJS","description":"A reactive programming library for JavaScript","fork":true,"url":"https://api.github.com/repos/luisgabriel/RxJS","forks_url":"https://api.github.com/repos/luisgabriel/RxJS/forks","keys_url":"https://api.github.com/repos/luisgabriel/RxJS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/luisgabriel/RxJS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/luisgabriel/RxJS/teams","hooks_url":"https://api.github.com/repos/luisgabriel/RxJS/hooks","issue_events_url":"https://api.github.com/repos/luisgabriel/RxJS/issues/events{/number}","events_url":"https://api.github.com/repos/luisgabriel/RxJS/events","assignees_url":"https://api.github.com/repos/luisgabriel/RxJS/assignees{/user}","branches_url":"https://api.github.com/repos/luisgabriel/RxJS/branches{/branch}","tags_url":"https://api.github.com/repos/luisgabriel/RxJS/tags","blobs_url":"https://api.github.com/repos/luisgabriel/RxJS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/luisgabriel/RxJS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/luisgabriel/RxJS/git/refs{/sha}","trees_url":"https://api.github.com/repos/luisgabriel/RxJS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/luisgabriel/RxJS/statuses/{sha}","languages_url":"https://api.github.com/repos/luisgabriel/RxJS/languages","stargazers_url":"https://api.github.com/repos/luisgabriel/RxJS/stargazers","contributors_url":"https://api.github.com/repos/luisgabriel/RxJS/contributors","subscribers_url":"https://api.github.com/repos/luisgabriel/RxJS/subscribers","subscription_url":"https://api.github.com/repos/luisgabriel/RxJS/subscription","commits_url":"https://api.github.com/repos/luisgabriel/RxJS/commits{/sha}","git_commits_url":"https://api.github.com/repos/luisgabriel/RxJS/git/commits{/sha}","comments_url":"https://api.github.com/repos/luisgabriel/RxJS/comments{/number}","issue_comment_url":"https://api.github.com/repos/luisgabriel/RxJS/issues/comments{/number}","contents_url":"https://api.github.com/repos/luisgabriel/RxJS/contents/{+path}","compare_url":"https://api.github.com/repos/luisgabriel/RxJS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/luisgabriel/RxJS/merges","archive_url":"https://api.github.com/repos/luisgabriel/RxJS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/luisgabriel/RxJS/downloads","issues_url":"https://api.github.com/repos/luisgabriel/RxJS/issues{/number}","pulls_url":"https://api.github.com/repos/luisgabriel/RxJS/pulls{/number}","milestones_url":"https://api.github.com/repos/luisgabriel/RxJS/milestones{/number}","notifications_url":"https://api.github.com/repos/luisgabriel/RxJS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/luisgabriel/RxJS/labels{/name}","releases_url":"https://api.github.com/repos/luisgabriel/RxJS/releases{/id}","deployments_url":"https://api.github.com/repos/luisgabriel/RxJS/deployments","created_at":"2015-10-01T00:15:31Z","updated_at":"2015-10-01T00:15:34Z","pushed_at":"2016-01-31T13:43:12Z","git_url":"git://github.com/luisgabriel/RxJS.git","ssh_url":"git@github.com:luisgabriel/RxJS.git","clone_url":"https://github.com/luisgabriel/RxJS.git","svn_url":"https://github.com/luisgabriel/RxJS","homepage":null,"size":4230,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"ReactiveX:master","ref":"master","sha":"a61424da37fe50dab61e20bec0e451503e51da43","user":{"login":"ReactiveX","id":6407041,"avatar_url":"https://avatars.githubusercontent.com/u/6407041?v=3","gravatar_id":"","url":"https://api.github.com/users/ReactiveX","html_url":"https://github.com/ReactiveX","followers_url":"https://api.github.com/users/ReactiveX/followers","following_url":"https://api.github.com/users/ReactiveX/following{/other_user}","gists_url":"https://api.github.com/users/ReactiveX/gists{/gist_id}","starred_url":"https://api.github.com/users/ReactiveX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReactiveX/subscriptions","organizations_url":"https://api.github.com/users/ReactiveX/orgs","repos_url":"https://api.github.com/users/ReactiveX/repos","events_url":"https://api.github.com/users/ReactiveX/events{/privacy}","received_events_url":"https://api.github.com/users/ReactiveX/received_events","type":"Organization","site_admin":false},"repo":{"id":32247847,"name":"RxJS","full_name":"ReactiveX/RxJS","owner":{"login":"ReactiveX","id":6407041,"avatar_url":"https://avatars.githubusercontent.com/u/6407041?v=3","gravatar_id":"","url":"https://api.github.com/users/ReactiveX","html_url":"https://github.com/ReactiveX","followers_url":"https://api.github.com/users/ReactiveX/followers","following_url":"https://api.github.com/users/ReactiveX/following{/other_user}","gists_url":"https://api.github.com/users/ReactiveX/gists{/gist_id}","starred_url":"https://api.github.com/users/ReactiveX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReactiveX/subscriptions","organizations_url":"https://api.github.com/users/ReactiveX/orgs","repos_url":"https://api.github.com/users/ReactiveX/repos","events_url":"https://api.github.com/users/ReactiveX/events{/privacy}","received_events_url":"https://api.github.com/users/ReactiveX/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ReactiveX/RxJS","description":"A reactive programming library for JavaScript","fork":false,"url":"https://api.github.com/repos/ReactiveX/RxJS","forks_url":"https://api.github.com/repos/ReactiveX/RxJS/forks","keys_url":"https://api.github.com/repos/ReactiveX/RxJS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ReactiveX/RxJS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ReactiveX/RxJS/teams","hooks_url":"https://api.github.com/repos/ReactiveX/RxJS/hooks","issue_events_url":"https://api.github.com/repos/ReactiveX/RxJS/issues/events{/number}","events_url":"https://api.github.com/repos/ReactiveX/RxJS/events","assignees_url":"https://api.github.com/repos/ReactiveX/RxJS/assignees{/user}","branches_url":"https://api.github.com/repos/ReactiveX/RxJS/branches{/branch}","tags_url":"https://api.github.com/repos/ReactiveX/RxJS/tags","blobs_url":"https://api.github.com/repos/ReactiveX/RxJS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ReactiveX/RxJS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ReactiveX/RxJS/git/refs{/sha}","trees_url":"https://api.github.com/repos/ReactiveX/RxJS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ReactiveX/RxJS/statuses/{sha}","languages_url":"https://api.github.com/repos/ReactiveX/RxJS/languages","stargazers_url":"https://api.github.com/repos/ReactiveX/RxJS/stargazers","contributors_url":"https://api.github.com/repos/ReactiveX/RxJS/contributors","subscribers_url":"https://api.github.com/repos/ReactiveX/RxJS/subscribers","subscription_url":"https://api.github.com/repos/ReactiveX/RxJS/subscription","commits_url":"https://api.github.com/repos/ReactiveX/RxJS/commits{/sha}","git_commits_url":"https://api.github.com/repos/ReactiveX/RxJS/git/commits{/sha}","comments_url":"https://api.github.com/repos/ReactiveX/RxJS/comments{/number}","issue_comment_url":"https://api.github.com/repos/ReactiveX/RxJS/issues/comments{/number}","contents_url":"https://api.github.com/repos/ReactiveX/RxJS/contents/{+path}","compare_url":"https://api.github.com/repos/ReactiveX/RxJS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ReactiveX/RxJS/merges","archive_url":"https://api.github.com/repos/ReactiveX/RxJS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ReactiveX/RxJS/downloads","issues_url":"https://api.github.com/repos/ReactiveX/RxJS/issues{/number}","pulls_url":"https://api.github.com/repos/ReactiveX/RxJS/pulls{/number}","milestones_url":"https://api.github.com/repos/ReactiveX/RxJS/milestones{/number}","notifications_url":"https://api.github.com/repos/ReactiveX/RxJS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ReactiveX/RxJS/labels{/name}","releases_url":"https://api.github.com/repos/ReactiveX/RxJS/releases{/id}","deployments_url":"https://api.github.com/repos/ReactiveX/RxJS/deployments","created_at":"2015-03-15T06:17:10Z","updated_at":"2016-01-31T14:14:29Z","pushed_at":"2016-01-31T08:06:06Z","git_url":"git://github.com/ReactiveX/RxJS.git","ssh_url":"git@github.com:ReactiveX/RxJS.git","clone_url":"https://github.com/ReactiveX/RxJS.git","svn_url":"https://github.com/ReactiveX/RxJS","homepage":null,"size":9327,"stargazers_count":1237,"watchers_count":1237,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":109,"mirror_url":null,"open_issues_count":68,"forks":109,"open_issues":68,"watchers":1237,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ReactiveX/RxJS/pulls/1266"},"html":{"href":"https://github.com/ReactiveX/RxJS/pull/1266"},"issue":{"href":"https://api.github.com/repos/ReactiveX/RxJS/issues/1266"},"comments":{"href":"https://api.github.com/repos/ReactiveX/RxJS/issues/1266/comments"},"review_comments":{"href":"https://api.github.com/repos/ReactiveX/RxJS/pulls/1266/comments"},"review_comment":{"href":"https://api.github.com/repos/ReactiveX/RxJS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ReactiveX/RxJS/pulls/1266/commits"},"statuses":{"href":"https://api.github.com/repos/ReactiveX/RxJS/statuses/959a596986c6032636bcfdfd39616c3c77435d84"}}}}