{"action":"created","comment":{"url":"https://api.github.com/repos/ReactiveX/RxJava/pulls/comments/24534237","id":24534237,"diff_hunk":"@@ -49,5 +53,81 @@ public void call(Subscriber<? super T> s) {\n     public T get() {\n         return t;\n     }\n+    \n+//    @Override","path":"src/main/java/rx/internal/util/ScalarSynchronousObservable.java","position":17,"original_position":17,"commit_id":"0c1f0fe771e1da2e64d8082f01a6c0ec472bb303","original_commit_id":"0c1f0fe771e1da2e64d8082f01a6c0ec472bb303","user":{"login":"benjchristensen","id":813492,"avatar_url":"https://avatars.githubusercontent.com/u/813492?v=3","gravatar_id":"","url":"https://api.github.com/users/benjchristensen","html_url":"https://github.com/benjchristensen","followers_url":"https://api.github.com/users/benjchristensen/followers","following_url":"https://api.github.com/users/benjchristensen/following{/other_user}","gists_url":"https://api.github.com/users/benjchristensen/gists{/gist_id}","starred_url":"https://api.github.com/users/benjchristensen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjchristensen/subscriptions","organizations_url":"https://api.github.com/users/benjchristensen/orgs","repos_url":"https://api.github.com/users/benjchristensen/repos","events_url":"https://api.github.com/users/benjchristensen/events{/privacy}","received_events_url":"https://api.github.com/users/benjchristensen/received_events","type":"User","site_admin":false},"body":"Are these commented out methods intended to be here?","created_at":"2015-02-11T21:18:41Z","updated_at":"2015-02-11T21:18:41Z","html_url":"https://github.com/ReactiveX/RxJava/pull/2603#discussion_r24534237","pull_request_url":"https://api.github.com/repos/ReactiveX/RxJava/pulls/2603","_links":{"self":{"href":"https://api.github.com/repos/ReactiveX/RxJava/pulls/comments/24534237"},"html":{"href":"https://github.com/ReactiveX/RxJava/pull/2603#discussion_r24534237"},"pull_request":{"href":"https://api.github.com/repos/ReactiveX/RxJava/pulls/2603"}}},"pull_request":{"url":"https://api.github.com/repos/ReactiveX/RxJava/pulls/2603","id":28683326,"html_url":"https://github.com/ReactiveX/RxJava/pull/2603","diff_url":"https://github.com/ReactiveX/RxJava/pull/2603.diff","patch_url":"https://github.com/ReactiveX/RxJava/pull/2603.patch","issue_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/2603","number":2603,"state":"open","locked":false,"title":"Optimized observeOn/subscribeOn","user":{"login":"akarnokd","id":1269832,"avatar_url":"https://avatars.githubusercontent.com/u/1269832?v=3","gravatar_id":"","url":"https://api.github.com/users/akarnokd","html_url":"https://github.com/akarnokd","followers_url":"https://api.github.com/users/akarnokd/followers","following_url":"https://api.github.com/users/akarnokd/following{/other_user}","gists_url":"https://api.github.com/users/akarnokd/gists{/gist_id}","starred_url":"https://api.github.com/users/akarnokd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akarnokd/subscriptions","organizations_url":"https://api.github.com/users/akarnokd/orgs","repos_url":"https://api.github.com/users/akarnokd/repos","events_url":"https://api.github.com/users/akarnokd/events{/privacy}","received_events_url":"https://api.github.com/users/akarnokd/received_events","type":"User","site_admin":false},"body":"Doing observeOn/subscribeOn on these is essentially the same operation.\r\n\r\nBenchmark results: (i7 4770k, Java 1.8u31, Windows 7 x64)\r\n```\r\ngradlew benchmarks \"-Pjmh=-f 1 -tu s -bm thrpt -wi 10 -i 10 -r 5 .*ComputationSchedulerPerf.*\"\r\n\r\nBenchmark                        (size)    1.x Score  Score error   PR  Score  Score error\r\nCompSchedulerPerf.observeOn           1   182479,416    11686,648  210536,292     9760,937  \r\nCompSchedulerPerf.observeOn          10   174911,567    13659,846  179245,342    12725,807  \r\nCompSchedulerPerf.observeOn         100    30997,516      958,587   27000,106      623,127  \r\nCompSchedulerPerf.observeOn        1000     6701,672      314,471    8623,296      703,255  \r\nCompSchedulerPerf.observeOn       10000      927,207       98,571     985,409       32,412  \r\nCompSchedulerPerf.observeOn      100000      111,968        1,176     110,597        2,883  \r\nCompSchedulerPerf.observeOn     1000000       11,790        0,195      11,512        0,146  \r\nCompSchedulerPerf.subscribeOn         1   202557,014    13692,298  204616,231    11272,351  \r\nCompSchedulerPerf.subscribeOn        10   180090,498    14058,995  190338,591     1822,349  \r\nCompSchedulerPerf.subscribeOn       100   113625,737    32012,148  114659,399    50494,246  \r\nCompSchedulerPerf.subscribeOn      1000    35600,359     2975,926   36856,078     1770,347  \r\nCompSchedulerPerf.subscribeOn     10000     4220,548      311,551    3942,293      368,052  \r\nCompSchedulerPerf.subscribeOn    100000      487,187       18,150     472,594       22,474  \r\nCompSchedulerPerf.subscribeOn   1000000       52,191        0,349      50,250        0,510  \r\n```\r\n\r\nUnfortunately, the benchmark results were quite hectic even with more warmup and iteration. I'd say the changes give +10% for the size = 1 case, but running the same code twice (observeOn 1, subscribeOn 1) gives inconsistent values. I suspect the main cause is the GC.","created_at":"2015-02-04T22:53:41Z","updated_at":"2015-02-11T21:18:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2f6932c44e24004abbae87f29ff0cb00791547db","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ReactiveX/RxJava/pulls/2603/commits","review_comments_url":"https://api.github.com/repos/ReactiveX/RxJava/pulls/2603/comments","review_comment_url":"https://api.github.com/repos/ReactiveX/RxJava/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/2603/comments","statuses_url":"https://api.github.com/repos/ReactiveX/RxJava/statuses/0c1f0fe771e1da2e64d8082f01a6c0ec472bb303","head":{"label":"akarnokd:SchedulerPerf0204","ref":"SchedulerPerf0204","sha":"0c1f0fe771e1da2e64d8082f01a6c0ec472bb303","user":{"login":"akarnokd","id":1269832,"avatar_url":"https://avatars.githubusercontent.com/u/1269832?v=3","gravatar_id":"","url":"https://api.github.com/users/akarnokd","html_url":"https://github.com/akarnokd","followers_url":"https://api.github.com/users/akarnokd/followers","following_url":"https://api.github.com/users/akarnokd/following{/other_user}","gists_url":"https://api.github.com/users/akarnokd/gists{/gist_id}","starred_url":"https://api.github.com/users/akarnokd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akarnokd/subscriptions","organizations_url":"https://api.github.com/users/akarnokd/orgs","repos_url":"https://api.github.com/users/akarnokd/repos","events_url":"https://api.github.com/users/akarnokd/events{/privacy}","received_events_url":"https://api.github.com/users/akarnokd/received_events","type":"User","site_admin":false},"repo":{"id":14518033,"name":"RxJava","full_name":"akarnokd/RxJava","owner":{"login":"akarnokd","id":1269832,"avatar_url":"https://avatars.githubusercontent.com/u/1269832?v=3","gravatar_id":"","url":"https://api.github.com/users/akarnokd","html_url":"https://github.com/akarnokd","followers_url":"https://api.github.com/users/akarnokd/followers","following_url":"https://api.github.com/users/akarnokd/following{/other_user}","gists_url":"https://api.github.com/users/akarnokd/gists{/gist_id}","starred_url":"https://api.github.com/users/akarnokd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akarnokd/subscriptions","organizations_url":"https://api.github.com/users/akarnokd/orgs","repos_url":"https://api.github.com/users/akarnokd/repos","events_url":"https://api.github.com/users/akarnokd/events{/privacy}","received_events_url":"https://api.github.com/users/akarnokd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/akarnokd/RxJava","description":"RxJava - a library for composing asynchronous and event-based programs using observable sequences for the Java VM.","fork":true,"url":"https://api.github.com/repos/akarnokd/RxJava","forks_url":"https://api.github.com/repos/akarnokd/RxJava/forks","keys_url":"https://api.github.com/repos/akarnokd/RxJava/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akarnokd/RxJava/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akarnokd/RxJava/teams","hooks_url":"https://api.github.com/repos/akarnokd/RxJava/hooks","issue_events_url":"https://api.github.com/repos/akarnokd/RxJava/issues/events{/number}","events_url":"https://api.github.com/repos/akarnokd/RxJava/events","assignees_url":"https://api.github.com/repos/akarnokd/RxJava/assignees{/user}","branches_url":"https://api.github.com/repos/akarnokd/RxJava/branches{/branch}","tags_url":"https://api.github.com/repos/akarnokd/RxJava/tags","blobs_url":"https://api.github.com/repos/akarnokd/RxJava/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akarnokd/RxJava/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akarnokd/RxJava/git/refs{/sha}","trees_url":"https://api.github.com/repos/akarnokd/RxJava/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akarnokd/RxJava/statuses/{sha}","languages_url":"https://api.github.com/repos/akarnokd/RxJava/languages","stargazers_url":"https://api.github.com/repos/akarnokd/RxJava/stargazers","contributors_url":"https://api.github.com/repos/akarnokd/RxJava/contributors","subscribers_url":"https://api.github.com/repos/akarnokd/RxJava/subscribers","subscription_url":"https://api.github.com/repos/akarnokd/RxJava/subscription","commits_url":"https://api.github.com/repos/akarnokd/RxJava/commits{/sha}","git_commits_url":"https://api.github.com/repos/akarnokd/RxJava/git/commits{/sha}","comments_url":"https://api.github.com/repos/akarnokd/RxJava/comments{/number}","issue_comment_url":"https://api.github.com/repos/akarnokd/RxJava/issues/comments/{number}","contents_url":"https://api.github.com/repos/akarnokd/RxJava/contents/{+path}","compare_url":"https://api.github.com/repos/akarnokd/RxJava/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akarnokd/RxJava/merges","archive_url":"https://api.github.com/repos/akarnokd/RxJava/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akarnokd/RxJava/downloads","issues_url":"https://api.github.com/repos/akarnokd/RxJava/issues{/number}","pulls_url":"https://api.github.com/repos/akarnokd/RxJava/pulls{/number}","milestones_url":"https://api.github.com/repos/akarnokd/RxJava/milestones{/number}","notifications_url":"https://api.github.com/repos/akarnokd/RxJava/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akarnokd/RxJava/labels{/name}","releases_url":"https://api.github.com/repos/akarnokd/RxJava/releases{/id}","created_at":"2013-11-19T08:04:52Z","updated_at":"2014-07-09T07:02:30Z","pushed_at":"2015-02-11T20:42:32Z","git_url":"git://github.com/akarnokd/RxJava.git","ssh_url":"git@github.com:akarnokd/RxJava.git","clone_url":"https://github.com/akarnokd/RxJava.git","svn_url":"https://github.com/akarnokd/RxJava","homepage":"","size":174400,"stargazers_count":1,"watchers_count":1,"language":"Java","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":1,"default_branch":"master"}},"base":{"label":"ReactiveX:1.x","ref":"1.x","sha":"3e5d8c8e0ae28e00e7b928bac2b1d64e9f652feb","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":7508411,"name":"RxJava","full_name":"ReactiveX/RxJava","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/RxJava","description":"RxJava – Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.","fork":false,"url":"https://api.github.com/repos/ReactiveX/RxJava","forks_url":"https://api.github.com/repos/ReactiveX/RxJava/forks","keys_url":"https://api.github.com/repos/ReactiveX/RxJava/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ReactiveX/RxJava/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ReactiveX/RxJava/teams","hooks_url":"https://api.github.com/repos/ReactiveX/RxJava/hooks","issue_events_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/events{/number}","events_url":"https://api.github.com/repos/ReactiveX/RxJava/events","assignees_url":"https://api.github.com/repos/ReactiveX/RxJava/assignees{/user}","branches_url":"https://api.github.com/repos/ReactiveX/RxJava/branches{/branch}","tags_url":"https://api.github.com/repos/ReactiveX/RxJava/tags","blobs_url":"https://api.github.com/repos/ReactiveX/RxJava/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ReactiveX/RxJava/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ReactiveX/RxJava/git/refs{/sha}","trees_url":"https://api.github.com/repos/ReactiveX/RxJava/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ReactiveX/RxJava/statuses/{sha}","languages_url":"https://api.github.com/repos/ReactiveX/RxJava/languages","stargazers_url":"https://api.github.com/repos/ReactiveX/RxJava/stargazers","contributors_url":"https://api.github.com/repos/ReactiveX/RxJava/contributors","subscribers_url":"https://api.github.com/repos/ReactiveX/RxJava/subscribers","subscription_url":"https://api.github.com/repos/ReactiveX/RxJava/subscription","commits_url":"https://api.github.com/repos/ReactiveX/RxJava/commits{/sha}","git_commits_url":"https://api.github.com/repos/ReactiveX/RxJava/git/commits{/sha}","comments_url":"https://api.github.com/repos/ReactiveX/RxJava/comments{/number}","issue_comment_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/comments/{number}","contents_url":"https://api.github.com/repos/ReactiveX/RxJava/contents/{+path}","compare_url":"https://api.github.com/repos/ReactiveX/RxJava/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ReactiveX/RxJava/merges","archive_url":"https://api.github.com/repos/ReactiveX/RxJava/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ReactiveX/RxJava/downloads","issues_url":"https://api.github.com/repos/ReactiveX/RxJava/issues{/number}","pulls_url":"https://api.github.com/repos/ReactiveX/RxJava/pulls{/number}","milestones_url":"https://api.github.com/repos/ReactiveX/RxJava/milestones{/number}","notifications_url":"https://api.github.com/repos/ReactiveX/RxJava/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ReactiveX/RxJava/labels{/name}","releases_url":"https://api.github.com/repos/ReactiveX/RxJava/releases{/id}","created_at":"2013-01-08T20:11:48Z","updated_at":"2015-02-11T21:12:43Z","pushed_at":"2015-02-11T21:12:43Z","git_url":"git://github.com/ReactiveX/RxJava.git","ssh_url":"git@github.com:ReactiveX/RxJava.git","clone_url":"https://github.com/ReactiveX/RxJava.git","svn_url":"https://github.com/ReactiveX/RxJava","homepage":"","size":385534,"stargazers_count":4377,"watchers_count":4377,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":649,"mirror_url":null,"open_issues_count":95,"forks":649,"open_issues":95,"watchers":4377,"default_branch":"1.x"}},"_links":{"self":{"href":"https://api.github.com/repos/ReactiveX/RxJava/pulls/2603"},"html":{"href":"https://github.com/ReactiveX/RxJava/pull/2603"},"issue":{"href":"https://api.github.com/repos/ReactiveX/RxJava/issues/2603"},"comments":{"href":"https://api.github.com/repos/ReactiveX/RxJava/issues/2603/comments"},"review_comments":{"href":"https://api.github.com/repos/ReactiveX/RxJava/pulls/2603/comments"},"review_comment":{"href":"https://api.github.com/repos/ReactiveX/RxJava/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ReactiveX/RxJava/pulls/2603/commits"},"statuses":{"href":"https://api.github.com/repos/ReactiveX/RxJava/statuses/0c1f0fe771e1da2e64d8082f01a6c0ec472bb303"}}}}