{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/228716824","pull_request_review_id":169059342,"id":228716824,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyODcxNjgyNA==","diff_hunk":"@@ -0,0 +1,90 @@\n+/*\n+ * Licensed to the Apache Software Foundation (ASF) under one or more\n+ * contributor license agreements.  See the NOTICE file distributed with\n+ * this work for additional information regarding copyright ownership.\n+ * The ASF licenses this file to You under the Apache License, Version 2.0\n+ * (the \"License\"); you may not use this file except in compliance with\n+ * the License.  You may obtain a copy of the License at\n+ *\n+ *    http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+package org.apache.spark.serializer\n+\n+import scala.concurrent._\n+import scala.concurrent.ExecutionContext.Implicits.global\n+import scala.concurrent.duration._\n+\n+import org.apache.spark.{SparkConf, SparkContext}\n+import org.apache.spark.benchmark.{Benchmark, BenchmarkBase}\n+import org.apache.spark.serializer.KryoTest._\n+import org.apache.spark.util.ThreadUtils\n+\n+/**\n+ * Benchmark for KryoPool vs old \"pool of 1\".\n+ * To run this benchmark:\n+ * {{{\n+ *   1. without sbt:\n+ *      bin/spark-submit --class <this class> --jars <spark core test jar>\n+ *   2. build/sbt \"core/test:runMain <this class>\"\n+ *   3. generate result:\n+ *      SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt \"core/test:runMain <this class>\"\n+ *      Results will be written to \"benchmarks/KryoSerializerBenchmark-results.txt\".\n+ * }}}\n+ */\n+object KryoSerializerBenchmark extends BenchmarkBase {\n+\n+  var sc: SparkContext = null\n+  val N = 500\n+  override def runBenchmarkSuite(): Unit = {\n+    val name = \"Benchmark KryoPool vs old\\\"pool of 1\\\" implementation\"\n+    runBenchmark(name) {\n+      val benchmark = new Benchmark(name, N, 10, output = output)\n+      Seq(true, false).foreach(usePool => run(usePool, benchmark))\n+      benchmark.run()\n+    }\n+  }\n+\n+  private def run(usePool: Boolean, benchmark: Benchmark): Unit = {\n+    lazy val sc = createSparkContext(usePool)\n+\n+    benchmark.addCase(s\"KryoPool:$usePool\") { _ =>\n+      val futures = for (_ <- 0 until N) yield {\n+        Future {\n+          sc.parallelize(0 until 10).map(i => i + 1).count()\n+        }\n+      }\n+\n+      val future = Future.sequence(futures)\n+\n+      ThreadUtils.awaitResult(future, 10.minutes)\n+    }\n+  }\n+\n+  def createSparkContext(usePool: Boolean): SparkContext = {","path":"core/src/test/scala/org/apache/spark/serializer/KryoSerializerBenchmark.scala","position":70,"original_position":70,"commit_id":"12d839af99e2f13926e18f5a50d19d0882a71ce0","original_commit_id":"12d839af99e2f13926e18f5a50d19d0882a71ce0","user":{"login":"xuanyuanking","id":4833765,"node_id":"MDQ6VXNlcjQ4MzM3NjU=","avatar_url":"https://avatars0.githubusercontent.com/u/4833765?v=4","gravatar_id":"","url":"https://api.github.com/users/xuanyuanking","html_url":"https://github.com/xuanyuanking","followers_url":"https://api.github.com/users/xuanyuanking/followers","following_url":"https://api.github.com/users/xuanyuanking/following{/other_user}","gists_url":"https://api.github.com/users/xuanyuanking/gists{/gist_id}","starred_url":"https://api.github.com/users/xuanyuanking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xuanyuanking/subscriptions","organizations_url":"https://api.github.com/users/xuanyuanking/orgs","repos_url":"https://api.github.com/users/xuanyuanking/repos","events_url":"https://api.github.com/users/xuanyuanking/events{/privacy}","received_events_url":"https://api.github.com/users/xuanyuanking/received_events","type":"User","site_admin":false},"body":"We add this but not override `getSparkSession` in `SqlBasedBenchmark`, is it because change conf in SparkSession doesn't work for SparkSession?","created_at":"2018-10-27T15:32:44Z","updated_at":"2018-10-27T15:36:38Z","html_url":"https://github.com/apache/spark/pull/22855#discussion_r228716824","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/22855","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/228716824"},"html":{"href":"https://github.com/apache/spark/pull/22855#discussion_r228716824"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/22855"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/22855","id":226197885,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2MTk3ODg1","html_url":"https://github.com/apache/spark/pull/22855","diff_url":"https://github.com/apache/spark/pull/22855.diff","patch_url":"https://github.com/apache/spark/pull/22855.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/22855","number":22855,"state":"open","locked":false,"title":"[SPARK-25839] [Core] Implement use of KryoPool in KryoSerializer","user":{"login":"patrickbrownsync","id":9904955,"node_id":"MDQ6VXNlcjk5MDQ5NTU=","avatar_url":"https://avatars2.githubusercontent.com/u/9904955?v=4","gravatar_id":"","url":"https://api.github.com/users/patrickbrownsync","html_url":"https://github.com/patrickbrownsync","followers_url":"https://api.github.com/users/patrickbrownsync/followers","following_url":"https://api.github.com/users/patrickbrownsync/following{/other_user}","gists_url":"https://api.github.com/users/patrickbrownsync/gists{/gist_id}","starred_url":"https://api.github.com/users/patrickbrownsync/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrickbrownsync/subscriptions","organizations_url":"https://api.github.com/users/patrickbrownsync/orgs","repos_url":"https://api.github.com/users/patrickbrownsync/repos","events_url":"https://api.github.com/users/patrickbrownsync/events{/privacy}","received_events_url":"https://api.github.com/users/patrickbrownsync/received_events","type":"User","site_admin":false},"body":"## What changes were proposed in this pull request?\r\n\r\n* Implement (optional) use of KryoPool in KryoSerializer, an alternative to the existing implementation of caching a Kryo instance inside KryoSerializerInstance\r\n* Add config key & documentation of spark.kryo.pool in order to turn this on\r\n* Add benchmark KryoSerializerBenchmark to compare new and old implementation\r\n* Add results of benchmark\r\n\r\n## How was this patch tested?\r\n\r\nAdded new tests inside KryoSerializerSuite to test the pool implementation as well as added the pool option to the existing regression testing for SPARK-7766\r\n\r\n\r\nThis is my original work and I license the work to the project under the project’s open source license.","created_at":"2018-10-26T19:09:40Z","updated_at":"2018-10-27T15:36:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"186bae65f20f4bcddc7b478e184ec14fd75296a4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/22855/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/22855/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/22855/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/12d839af99e2f13926e18f5a50d19d0882a71ce0","head":{"label":"Blyncs:kryo-pool","ref":"kryo-pool","sha":"12d839af99e2f13926e18f5a50d19d0882a71ce0","user":{"login":"Blyncs","id":10016903,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMDE2OTAz","avatar_url":"https://avatars0.githubusercontent.com/u/10016903?v=4","gravatar_id":"","url":"https://api.github.com/users/Blyncs","html_url":"https://github.com/Blyncs","followers_url":"https://api.github.com/users/Blyncs/followers","following_url":"https://api.github.com/users/Blyncs/following{/other_user}","gists_url":"https://api.github.com/users/Blyncs/gists{/gist_id}","starred_url":"https://api.github.com/users/Blyncs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Blyncs/subscriptions","organizations_url":"https://api.github.com/users/Blyncs/orgs","repos_url":"https://api.github.com/users/Blyncs/repos","events_url":"https://api.github.com/users/Blyncs/events{/privacy}","received_events_url":"https://api.github.com/users/Blyncs/received_events","type":"Organization","site_admin":false},"repo":{"id":76831103,"node_id":"MDEwOlJlcG9zaXRvcnk3NjgzMTEwMw==","name":"spark","full_name":"Blyncs/spark","private":false,"owner":{"login":"Blyncs","id":10016903,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMDE2OTAz","avatar_url":"https://avatars0.githubusercontent.com/u/10016903?v=4","gravatar_id":"","url":"https://api.github.com/users/Blyncs","html_url":"https://github.com/Blyncs","followers_url":"https://api.github.com/users/Blyncs/followers","following_url":"https://api.github.com/users/Blyncs/following{/other_user}","gists_url":"https://api.github.com/users/Blyncs/gists{/gist_id}","starred_url":"https://api.github.com/users/Blyncs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Blyncs/subscriptions","organizations_url":"https://api.github.com/users/Blyncs/orgs","repos_url":"https://api.github.com/users/Blyncs/repos","events_url":"https://api.github.com/users/Blyncs/events{/privacy}","received_events_url":"https://api.github.com/users/Blyncs/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Blyncs/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/Blyncs/spark","forks_url":"https://api.github.com/repos/Blyncs/spark/forks","keys_url":"https://api.github.com/repos/Blyncs/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Blyncs/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Blyncs/spark/teams","hooks_url":"https://api.github.com/repos/Blyncs/spark/hooks","issue_events_url":"https://api.github.com/repos/Blyncs/spark/issues/events{/number}","events_url":"https://api.github.com/repos/Blyncs/spark/events","assignees_url":"https://api.github.com/repos/Blyncs/spark/assignees{/user}","branches_url":"https://api.github.com/repos/Blyncs/spark/branches{/branch}","tags_url":"https://api.github.com/repos/Blyncs/spark/tags","blobs_url":"https://api.github.com/repos/Blyncs/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Blyncs/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Blyncs/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/Blyncs/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Blyncs/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/Blyncs/spark/languages","stargazers_url":"https://api.github.com/repos/Blyncs/spark/stargazers","contributors_url":"https://api.github.com/repos/Blyncs/spark/contributors","subscribers_url":"https://api.github.com/repos/Blyncs/spark/subscribers","subscription_url":"https://api.github.com/repos/Blyncs/spark/subscription","commits_url":"https://api.github.com/repos/Blyncs/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/Blyncs/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/Blyncs/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/Blyncs/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/Blyncs/spark/contents/{+path}","compare_url":"https://api.github.com/repos/Blyncs/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Blyncs/spark/merges","archive_url":"https://api.github.com/repos/Blyncs/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Blyncs/spark/downloads","issues_url":"https://api.github.com/repos/Blyncs/spark/issues{/number}","pulls_url":"https://api.github.com/repos/Blyncs/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/Blyncs/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/Blyncs/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Blyncs/spark/labels{/name}","releases_url":"https://api.github.com/repos/Blyncs/spark/releases{/id}","deployments_url":"https://api.github.com/repos/Blyncs/spark/deployments","created_at":"2016-12-19T05:31:52Z","updated_at":"2018-05-09T18:09:06Z","pushed_at":"2018-10-26T19:23:43Z","git_url":"git://github.com/Blyncs/spark.git","ssh_url":"git@github.com:Blyncs/spark.git","clone_url":"https://github.com/Blyncs/spark.git","svn_url":"https://github.com/Blyncs/spark","homepage":null,"size":280273,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"d367bdcf521f564d2d7066257200be26b27ea926","user":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnkxNzE2NTY1OA==","name":"spark","full_name":"apache/spark","private":false,"owner":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","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},"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}","deployments_url":"https://api.github.com/repos/apache/spark/deployments","created_at":"2014-02-25T08:00:08Z","updated_at":"2018-10-27T14:22:01Z","pushed_at":"2018-10-27T14:59:53Z","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":285598,"stargazers_count":19246,"watchers_count":19246,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":17257,"mirror_url":null,"archived":false,"open_issues_count":512,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":17257,"open_issues":512,"watchers":19246,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/22855"},"html":{"href":"https://github.com/apache/spark/pull/22855"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/22855"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/22855/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/22855/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/22855/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/12d839af99e2f13926e18f5a50d19d0882a71ce0"}},"author_association":"NONE"}}
{"actor":{"display_login":"xuanyuanking"}}