{"action":"created","comment":{"url":"https://api.github.com/repos/akka/akka/pulls/comments/71673563","id":71673563,"diff_hunk":"@@ -0,0 +1,322 @@\n+/**\n+ * Copyright (C) 2014-2016 Lightbend Inc. <http://www.lightbend.com>\n+ */\n+\n+package akka.stream\n+\n+import java.util.concurrent.{ CountDownLatch, TimeUnit }\n+\n+import akka.NotUsed\n+import akka.actor.ActorSystem\n+import akka.stream.impl.fusing.GraphStages\n+import akka.stream.scaladsl._\n+import akka.stream.stage._\n+import org.openjdk.jmh.annotations.{ OperationsPerInvocation, _ }\n+\n+import scala.concurrent.Await\n+import scala.concurrent.duration._\n+\n+object FusedGraphsBenchmark {\n+  val ElementCount = 100 * 1000\n+\n+  @volatile var blackhole: org.openjdk.jmh.infra.Blackhole = _\n+}\n+\n+// Just to avoid allocations and still have a way to do some work in stages. The value itself does not matter\n+// so no issues with sharing (the result does not make any sense, but hey)\n+class MutableElement(var value: Int)\n+\n+class TestSource(elems: Array[MutableElement]) extends GraphStage[SourceShape[MutableElement]] {\n+  val out = Outlet[MutableElement](\"TestSource.out\")\n+  override val shape = SourceShape(out)\n+\n+  override def createLogic(inheritedAttributes: Attributes): GraphStageLogic = new GraphStageLogic(shape) with OutHandler {\n+    private[this] var left = FusedGraphsBenchmark.ElementCount - 1\n+\n+    override def onPull(): Unit = {\n+      if (left >= 0) {\n+        push(out, elems(left))\n+        left -= 1\n+      } else completeStage()\n+    }\n+\n+    setHandler(out, this)\n+  }\n+}\n+\n+class JitSafeCompletionLatch extends GraphStageWithMaterializedValue[SinkShape[MutableElement], CountDownLatch] {\n+  val in = Inlet[MutableElement](\"JitSafeCompletionLatch.in\")\n+  override val shape = SinkShape(in)\n+\n+  override def createLogicAndMaterializedValue(inheritedAttributes: Attributes): (GraphStageLogic, CountDownLatch) = {\n+    val latch = new CountDownLatch(1)\n+    val logic = new GraphStageLogic(shape) with InHandler {\n+      private[this] var sum = 0\n+\n+      override def preStart(): Unit = pull(in)\n+      override def onPush(): Unit = {\n+        sum += grab(in).value\n+        pull(in)\n+      }\n+\n+      override def onUpstreamFinish(): Unit = {\n+        // Do not ignore work along the chain\n+        FusedGraphsBenchmark.blackhole.consume(sum)","path":"akka-bench-jmh/src/main/scala/akka/stream/FusedGraphsBenchmark.scala","position":64,"original_position":64,"commit_id":"9751231836a14f12de77d2d6788f964fbbe4dba9","original_commit_id":"47128b1e9c49164a069995cf05806b5a5fa3a645","user":{"login":"drewhk","id":932285,"avatar_url":"https://avatars.githubusercontent.com/u/932285?v=3","gravatar_id":"","url":"https://api.github.com/users/drewhk","html_url":"https://github.com/drewhk","followers_url":"https://api.github.com/users/drewhk/followers","following_url":"https://api.github.com/users/drewhk/following{/other_user}","gists_url":"https://api.github.com/users/drewhk/gists{/gist_id}","starred_url":"https://api.github.com/users/drewhk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewhk/subscriptions","organizations_url":"https://api.github.com/users/drewhk/orgs","repos_url":"https://api.github.com/users/drewhk/repos","events_url":"https://api.github.com/users/drewhk/events{/privacy}","received_events_url":"https://api.github.com/users/drewhk/received_events","type":"User","site_admin":false},"body":"well, better safe than sorry.","created_at":"2016-07-21T09:24:36Z","updated_at":"2016-07-21T09:24:36Z","html_url":"https://github.com/akka/akka/pull/21002#discussion_r71673563","pull_request_url":"https://api.github.com/repos/akka/akka/pulls/21002","_links":{"self":{"href":"https://api.github.com/repos/akka/akka/pulls/comments/71673563"},"html":{"href":"https://github.com/akka/akka/pull/21002#discussion_r71673563"},"pull_request":{"href":"https://api.github.com/repos/akka/akka/pulls/21002"}}},"pull_request":{"url":"https://api.github.com/repos/akka/akka/pulls/21002","id":78165085,"html_url":"https://github.com/akka/akka/pull/21002","diff_url":"https://github.com/akka/akka/pull/21002.diff","patch_url":"https://github.com/akka/akka/pull/21002.patch","issue_url":"https://api.github.com/repos/akka/akka/issues/21002","number":21002,"state":"open","locked":false,"title":"WIP - Interpreter improvements","user":{"login":"drewhk","id":932285,"avatar_url":"https://avatars.githubusercontent.com/u/932285?v=3","gravatar_id":"","url":"https://api.github.com/users/drewhk","html_url":"https://github.com/drewhk","followers_url":"https://api.github.com/users/drewhk/followers","following_url":"https://api.github.com/users/drewhk/following{/other_user}","gists_url":"https://api.github.com/users/drewhk/gists{/gist_id}","starred_url":"https://api.github.com/users/drewhk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewhk/subscriptions","organizations_url":"https://api.github.com/users/drewhk/orgs","repos_url":"https://api.github.com/users/drewhk/repos","events_url":"https://api.github.com/users/drewhk/events{/privacy}","received_events_url":"https://api.github.com/users/drewhk/received_events","type":"User","site_admin":false},"body":"** DO NOT MERGE **\r\nIt does not even pass tests right now.","created_at":"2016-07-20T15:12:22Z","updated_at":"2016-07-21T09:24:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4d932877d9a60f6b570adf157f167e4f77086970","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/akka/akka/pulls/21002/commits","review_comments_url":"https://api.github.com/repos/akka/akka/pulls/21002/comments","review_comment_url":"https://api.github.com/repos/akka/akka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/akka/akka/issues/21002/comments","statuses_url":"https://api.github.com/repos/akka/akka/statuses/9751231836a14f12de77d2d6788f964fbbe4dba9","head":{"label":"drewhk:wip-interpreter-improvements-drewhk","ref":"wip-interpreter-improvements-drewhk","sha":"9751231836a14f12de77d2d6788f964fbbe4dba9","user":{"login":"drewhk","id":932285,"avatar_url":"https://avatars.githubusercontent.com/u/932285?v=3","gravatar_id":"","url":"https://api.github.com/users/drewhk","html_url":"https://github.com/drewhk","followers_url":"https://api.github.com/users/drewhk/followers","following_url":"https://api.github.com/users/drewhk/following{/other_user}","gists_url":"https://api.github.com/users/drewhk/gists{/gist_id}","starred_url":"https://api.github.com/users/drewhk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewhk/subscriptions","organizations_url":"https://api.github.com/users/drewhk/orgs","repos_url":"https://api.github.com/users/drewhk/repos","events_url":"https://api.github.com/users/drewhk/events{/privacy}","received_events_url":"https://api.github.com/users/drewhk/received_events","type":"User","site_admin":false},"repo":{"id":4322312,"name":"akka","full_name":"drewhk/akka","owner":{"login":"drewhk","id":932285,"avatar_url":"https://avatars.githubusercontent.com/u/932285?v=3","gravatar_id":"","url":"https://api.github.com/users/drewhk","html_url":"https://github.com/drewhk","followers_url":"https://api.github.com/users/drewhk/followers","following_url":"https://api.github.com/users/drewhk/following{/other_user}","gists_url":"https://api.github.com/users/drewhk/gists{/gist_id}","starred_url":"https://api.github.com/users/drewhk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewhk/subscriptions","organizations_url":"https://api.github.com/users/drewhk/orgs","repos_url":"https://api.github.com/users/drewhk/repos","events_url":"https://api.github.com/users/drewhk/events{/privacy}","received_events_url":"https://api.github.com/users/drewhk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/drewhk/akka","description":"Akka Project","fork":true,"url":"https://api.github.com/repos/drewhk/akka","forks_url":"https://api.github.com/repos/drewhk/akka/forks","keys_url":"https://api.github.com/repos/drewhk/akka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/drewhk/akka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/drewhk/akka/teams","hooks_url":"https://api.github.com/repos/drewhk/akka/hooks","issue_events_url":"https://api.github.com/repos/drewhk/akka/issues/events{/number}","events_url":"https://api.github.com/repos/drewhk/akka/events","assignees_url":"https://api.github.com/repos/drewhk/akka/assignees{/user}","branches_url":"https://api.github.com/repos/drewhk/akka/branches{/branch}","tags_url":"https://api.github.com/repos/drewhk/akka/tags","blobs_url":"https://api.github.com/repos/drewhk/akka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/drewhk/akka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/drewhk/akka/git/refs{/sha}","trees_url":"https://api.github.com/repos/drewhk/akka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/drewhk/akka/statuses/{sha}","languages_url":"https://api.github.com/repos/drewhk/akka/languages","stargazers_url":"https://api.github.com/repos/drewhk/akka/stargazers","contributors_url":"https://api.github.com/repos/drewhk/akka/contributors","subscribers_url":"https://api.github.com/repos/drewhk/akka/subscribers","subscription_url":"https://api.github.com/repos/drewhk/akka/subscription","commits_url":"https://api.github.com/repos/drewhk/akka/commits{/sha}","git_commits_url":"https://api.github.com/repos/drewhk/akka/git/commits{/sha}","comments_url":"https://api.github.com/repos/drewhk/akka/comments{/number}","issue_comment_url":"https://api.github.com/repos/drewhk/akka/issues/comments{/number}","contents_url":"https://api.github.com/repos/drewhk/akka/contents/{+path}","compare_url":"https://api.github.com/repos/drewhk/akka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/drewhk/akka/merges","archive_url":"https://api.github.com/repos/drewhk/akka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/drewhk/akka/downloads","issues_url":"https://api.github.com/repos/drewhk/akka/issues{/number}","pulls_url":"https://api.github.com/repos/drewhk/akka/pulls{/number}","milestones_url":"https://api.github.com/repos/drewhk/akka/milestones{/number}","notifications_url":"https://api.github.com/repos/drewhk/akka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/drewhk/akka/labels{/name}","releases_url":"https://api.github.com/repos/drewhk/akka/releases{/id}","deployments_url":"https://api.github.com/repos/drewhk/akka/deployments","created_at":"2012-05-14T09:57:34Z","updated_at":"2015-02-17T12:40:08Z","pushed_at":"2016-07-20T15:11:10Z","git_url":"git://github.com/drewhk/akka.git","ssh_url":"git@github.com:drewhk/akka.git","clone_url":"https://github.com/drewhk/akka.git","svn_url":"https://github.com/drewhk/akka","homepage":"http://akka.io","size":193854,"stargazers_count":1,"watchers_count":1,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"akka:master","ref":"master","sha":"fde9d86879ad66b501f4ff3af939baee6a323fcf","user":{"login":"akka","id":1496237,"avatar_url":"https://avatars.githubusercontent.com/u/1496237?v=3","gravatar_id":"","url":"https://api.github.com/users/akka","html_url":"https://github.com/akka","followers_url":"https://api.github.com/users/akka/followers","following_url":"https://api.github.com/users/akka/following{/other_user}","gists_url":"https://api.github.com/users/akka/gists{/gist_id}","starred_url":"https://api.github.com/users/akka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka/subscriptions","organizations_url":"https://api.github.com/users/akka/orgs","repos_url":"https://api.github.com/users/akka/repos","events_url":"https://api.github.com/users/akka/events{/privacy}","received_events_url":"https://api.github.com/users/akka/received_events","type":"Organization","site_admin":false},"repo":{"id":130013,"name":"akka","full_name":"akka/akka","owner":{"login":"akka","id":1496237,"avatar_url":"https://avatars.githubusercontent.com/u/1496237?v=3","gravatar_id":"","url":"https://api.github.com/users/akka","html_url":"https://github.com/akka","followers_url":"https://api.github.com/users/akka/followers","following_url":"https://api.github.com/users/akka/following{/other_user}","gists_url":"https://api.github.com/users/akka/gists{/gist_id}","starred_url":"https://api.github.com/users/akka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka/subscriptions","organizations_url":"https://api.github.com/users/akka/orgs","repos_url":"https://api.github.com/users/akka/repos","events_url":"https://api.github.com/users/akka/events{/privacy}","received_events_url":"https://api.github.com/users/akka/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/akka/akka","description":"Akka Project","fork":false,"url":"https://api.github.com/repos/akka/akka","forks_url":"https://api.github.com/repos/akka/akka/forks","keys_url":"https://api.github.com/repos/akka/akka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akka/akka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akka/akka/teams","hooks_url":"https://api.github.com/repos/akka/akka/hooks","issue_events_url":"https://api.github.com/repos/akka/akka/issues/events{/number}","events_url":"https://api.github.com/repos/akka/akka/events","assignees_url":"https://api.github.com/repos/akka/akka/assignees{/user}","branches_url":"https://api.github.com/repos/akka/akka/branches{/branch}","tags_url":"https://api.github.com/repos/akka/akka/tags","blobs_url":"https://api.github.com/repos/akka/akka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akka/akka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akka/akka/git/refs{/sha}","trees_url":"https://api.github.com/repos/akka/akka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akka/akka/statuses/{sha}","languages_url":"https://api.github.com/repos/akka/akka/languages","stargazers_url":"https://api.github.com/repos/akka/akka/stargazers","contributors_url":"https://api.github.com/repos/akka/akka/contributors","subscribers_url":"https://api.github.com/repos/akka/akka/subscribers","subscription_url":"https://api.github.com/repos/akka/akka/subscription","commits_url":"https://api.github.com/repos/akka/akka/commits{/sha}","git_commits_url":"https://api.github.com/repos/akka/akka/git/commits{/sha}","comments_url":"https://api.github.com/repos/akka/akka/comments{/number}","issue_comment_url":"https://api.github.com/repos/akka/akka/issues/comments{/number}","contents_url":"https://api.github.com/repos/akka/akka/contents/{+path}","compare_url":"https://api.github.com/repos/akka/akka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akka/akka/merges","archive_url":"https://api.github.com/repos/akka/akka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akka/akka/downloads","issues_url":"https://api.github.com/repos/akka/akka/issues{/number}","pulls_url":"https://api.github.com/repos/akka/akka/pulls{/number}","milestones_url":"https://api.github.com/repos/akka/akka/milestones{/number}","notifications_url":"https://api.github.com/repos/akka/akka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akka/akka/labels{/name}","releases_url":"https://api.github.com/repos/akka/akka/releases{/id}","deployments_url":"https://api.github.com/repos/akka/akka/deployments","created_at":"2009-02-16T12:51:54Z","updated_at":"2016-07-21T01:43:07Z","pushed_at":"2016-07-21T09:21:45Z","git_url":"git://github.com/akka/akka.git","ssh_url":"git@github.com:akka/akka.git","clone_url":"https://github.com/akka/akka.git","svn_url":"https://github.com/akka/akka","homepage":"http://akka.io","size":236365,"stargazers_count":5789,"watchers_count":5789,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1823,"mirror_url":null,"open_issues_count":686,"forks":1823,"open_issues":686,"watchers":5789,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/akka/akka/pulls/21002"},"html":{"href":"https://github.com/akka/akka/pull/21002"},"issue":{"href":"https://api.github.com/repos/akka/akka/issues/21002"},"comments":{"href":"https://api.github.com/repos/akka/akka/issues/21002/comments"},"review_comments":{"href":"https://api.github.com/repos/akka/akka/pulls/21002/comments"},"review_comment":{"href":"https://api.github.com/repos/akka/akka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/akka/akka/pulls/21002/commits"},"statuses":{"href":"https://api.github.com/repos/akka/akka/statuses/9751231836a14f12de77d2d6788f964fbbe4dba9"}}}}
{"actor":{"display_login":"drewhk"}}