{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/34277099","id":34277099,"diff_hunk":"@@ -1078,7 +1078,9 @@ abstract class RDD[T: ClassTag](\n       val scale = math.max(math.ceil(math.pow(numPartitions, 1.0 / depth)).toInt, 2)\n       // If creating an extra level doesn't help reduce\n       // the wall-clock time, we stop tree aggregation.\n-      while (numPartitions > scale + numPartitions / scale) {\n+\n+      // Don't trigger treeAggregation for 5 partitions\n+      while (numPartitions > 5 && (numPartitions > scale + numPartitions / scale)) {","path":"core/src/main/scala/org/apache/spark/rdd/RDD.scala","position":7,"original_position":7,"commit_id":"a6fed07f65c3c71e19f231c54fa43fc4904b040d","original_commit_id":"a6fed07f65c3c71e19f231c54fa43fc4904b040d","user":{"login":"mengxr","id":829644,"avatar_url":"https://avatars.githubusercontent.com/u/829644?v=3","gravatar_id":"","url":"https://api.github.com/users/mengxr","html_url":"https://github.com/mengxr","followers_url":"https://api.github.com/users/mengxr/followers","following_url":"https://api.github.com/users/mengxr/following{/other_user}","gists_url":"https://api.github.com/users/mengxr/gists{/gist_id}","starred_url":"https://api.github.com/users/mengxr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mengxr/subscriptions","organizations_url":"https://api.github.com/users/mengxr/orgs","repos_url":"https://api.github.com/users/mengxr/repos","events_url":"https://api.github.com/users/mengxr/events{/privacy}","received_events_url":"https://api.github.com/users/mengxr/received_events","type":"User","site_admin":false},"body":"That might be wrong. The heuristic is to compare the cost (wall-clock time) of collecting directly (numPartitions) vs. make another level then collect. (`scale` (for each node in the mid-level) + `math.ceil(1.0 * numPartitions / scale)` (for collecting to driver)).","created_at":"2015-07-09T16:58:51Z","updated_at":"2015-07-09T16:58:51Z","html_url":"https://github.com/apache/spark/pull/7168#discussion_r34277099","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/7168","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/34277099"},"html":{"href":"https://github.com/apache/spark/pull/7168#discussion_r34277099"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/7168"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/7168","id":39024724,"html_url":"https://github.com/apache/spark/pull/7168","diff_url":"https://github.com/apache/spark/pull/7168.diff","patch_url":"https://github.com/apache/spark/pull/7168.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/7168","number":7168,"state":"open","locked":false,"title":"[SPARK-8695] [core] [WIP] TreeAggregation shouldn't be triggered for …","user":{"login":"piganesh","id":13070848,"avatar_url":"https://avatars.githubusercontent.com/u/13070848?v=3","gravatar_id":"","url":"https://api.github.com/users/piganesh","html_url":"https://github.com/piganesh","followers_url":"https://api.github.com/users/piganesh/followers","following_url":"https://api.github.com/users/piganesh/following{/other_user}","gists_url":"https://api.github.com/users/piganesh/gists{/gist_id}","starred_url":"https://api.github.com/users/piganesh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piganesh/subscriptions","organizations_url":"https://api.github.com/users/piganesh/orgs","repos_url":"https://api.github.com/users/piganesh/repos","events_url":"https://api.github.com/users/piganesh/events{/privacy}","received_events_url":"https://api.github.com/users/piganesh/received_events","type":"User","site_admin":false},"body":"…5 partitions","created_at":"2015-07-01T21:00:19Z","updated_at":"2015-07-09T16:58:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e866962cb79cdcdcbd611d51a92f5e0ca75c62fd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/7168/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/7168/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/7168/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/a6fed07f65c3c71e19f231c54fa43fc4904b040d","head":{"label":"ibmsoe:SPARK-8695","ref":"SPARK-8695","sha":"a6fed07f65c3c71e19f231c54fa43fc4904b040d","user":{"login":"ibmsoe","id":6682298,"avatar_url":"https://avatars.githubusercontent.com/u/6682298?v=3","gravatar_id":"","url":"https://api.github.com/users/ibmsoe","html_url":"https://github.com/ibmsoe","followers_url":"https://api.github.com/users/ibmsoe/followers","following_url":"https://api.github.com/users/ibmsoe/following{/other_user}","gists_url":"https://api.github.com/users/ibmsoe/gists{/gist_id}","starred_url":"https://api.github.com/users/ibmsoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibmsoe/subscriptions","organizations_url":"https://api.github.com/users/ibmsoe/orgs","repos_url":"https://api.github.com/users/ibmsoe/repos","events_url":"https://api.github.com/users/ibmsoe/events{/privacy}","received_events_url":"https://api.github.com/users/ibmsoe/received_events","type":"Organization","site_admin":false},"repo":{"id":25604567,"name":"spark","full_name":"ibmsoe/spark","owner":{"login":"ibmsoe","id":6682298,"avatar_url":"https://avatars.githubusercontent.com/u/6682298?v=3","gravatar_id":"","url":"https://api.github.com/users/ibmsoe","html_url":"https://github.com/ibmsoe","followers_url":"https://api.github.com/users/ibmsoe/followers","following_url":"https://api.github.com/users/ibmsoe/following{/other_user}","gists_url":"https://api.github.com/users/ibmsoe/gists{/gist_id}","starred_url":"https://api.github.com/users/ibmsoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibmsoe/subscriptions","organizations_url":"https://api.github.com/users/ibmsoe/orgs","repos_url":"https://api.github.com/users/ibmsoe/repos","events_url":"https://api.github.com/users/ibmsoe/events{/privacy}","received_events_url":"https://api.github.com/users/ibmsoe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ibmsoe/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/ibmsoe/spark","forks_url":"https://api.github.com/repos/ibmsoe/spark/forks","keys_url":"https://api.github.com/repos/ibmsoe/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ibmsoe/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ibmsoe/spark/teams","hooks_url":"https://api.github.com/repos/ibmsoe/spark/hooks","issue_events_url":"https://api.github.com/repos/ibmsoe/spark/issues/events{/number}","events_url":"https://api.github.com/repos/ibmsoe/spark/events","assignees_url":"https://api.github.com/repos/ibmsoe/spark/assignees{/user}","branches_url":"https://api.github.com/repos/ibmsoe/spark/branches{/branch}","tags_url":"https://api.github.com/repos/ibmsoe/spark/tags","blobs_url":"https://api.github.com/repos/ibmsoe/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ibmsoe/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ibmsoe/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/ibmsoe/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ibmsoe/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/ibmsoe/spark/languages","stargazers_url":"https://api.github.com/repos/ibmsoe/spark/stargazers","contributors_url":"https://api.github.com/repos/ibmsoe/spark/contributors","subscribers_url":"https://api.github.com/repos/ibmsoe/spark/subscribers","subscription_url":"https://api.github.com/repos/ibmsoe/spark/subscription","commits_url":"https://api.github.com/repos/ibmsoe/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/ibmsoe/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/ibmsoe/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/ibmsoe/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/ibmsoe/spark/contents/{+path}","compare_url":"https://api.github.com/repos/ibmsoe/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ibmsoe/spark/merges","archive_url":"https://api.github.com/repos/ibmsoe/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ibmsoe/spark/downloads","issues_url":"https://api.github.com/repos/ibmsoe/spark/issues{/number}","pulls_url":"https://api.github.com/repos/ibmsoe/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/ibmsoe/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/ibmsoe/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ibmsoe/spark/labels{/name}","releases_url":"https://api.github.com/repos/ibmsoe/spark/releases{/id}","created_at":"2014-10-22T21:10:00Z","updated_at":"2015-04-29T03:37:25Z","pushed_at":"2015-07-08T21:22:15Z","git_url":"git://github.com/ibmsoe/spark.git","ssh_url":"git@github.com:ibmsoe/spark.git","clone_url":"https://github.com/ibmsoe/spark.git","svn_url":"https://github.com/ibmsoe/spark","homepage":null,"size":113158,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":0,"forks":3,"open_issues":0,"watchers":0,"default_branch":"branch-1.3.1"}},"base":{"label":"apache:master","ref":"master","sha":"1ce6428907b4ddcf52dbf0c86196d82ab7392442","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":17165658,"name":"spark","full_name":"apache/spark","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/spark","description":"Mirror of Apache Spark","fork":false,"url":"https://api.github.com/repos/apache/spark","forks_url":"https://api.github.com/repos/apache/spark/forks","keys_url":"https://api.github.com/repos/apache/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/spark/teams","hooks_url":"https://api.github.com/repos/apache/spark/hooks","issue_events_url":"https://api.github.com/repos/apache/spark/issues/events{/number}","events_url":"https://api.github.com/repos/apache/spark/events","assignees_url":"https://api.github.com/repos/apache/spark/assignees{/user}","branches_url":"https://api.github.com/repos/apache/spark/branches{/branch}","tags_url":"https://api.github.com/repos/apache/spark/tags","blobs_url":"https://api.github.com/repos/apache/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/spark/languages","stargazers_url":"https://api.github.com/repos/apache/spark/stargazers","contributors_url":"https://api.github.com/repos/apache/spark/contributors","subscribers_url":"https://api.github.com/repos/apache/spark/subscribers","subscription_url":"https://api.github.com/repos/apache/spark/subscription","commits_url":"https://api.github.com/repos/apache/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/spark/contents/{+path}","compare_url":"https://api.github.com/repos/apache/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/spark/merges","archive_url":"https://api.github.com/repos/apache/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/spark/downloads","issues_url":"https://api.github.com/repos/apache/spark/issues{/number}","pulls_url":"https://api.github.com/repos/apache/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/spark/labels{/name}","releases_url":"https://api.github.com/repos/apache/spark/releases{/id}","created_at":"2014-02-25T08:00:08Z","updated_at":"2015-07-09T15:49:36Z","pushed_at":"2015-07-09T16:57:34Z","git_url":"git://github.com/apache/spark.git","ssh_url":"git@github.com:apache/spark.git","clone_url":"https://github.com/apache/spark.git","svn_url":"https://github.com/apache/spark","homepage":null,"size":1497342,"stargazers_count":4696,"watchers_count":4696,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4157,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":349,"forks":4157,"open_issues":349,"watchers":4696,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/7168"},"html":{"href":"https://github.com/apache/spark/pull/7168"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/7168"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/7168/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/7168/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/7168/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/a6fed07f65c3c71e19f231c54fa43fc4904b040d"}}}}