{"action":"created","issue":{"url":"https://api.github.com/repos/akka/akka/issues/22560","repository_url":"https://api.github.com/repos/akka/akka","labels_url":"https://api.github.com/repos/akka/akka/issues/22560/labels{/name}","comments_url":"https://api.github.com/repos/akka/akka/issues/22560/comments","events_url":"https://api.github.com/repos/akka/akka/issues/22560/events","html_url":"https://github.com/akka/akka/pull/22560","id":214168788,"node_id":"MDExOlB1bGxSZXF1ZXN0MTEwNjkwNzA1","number":22560,"title":"Embed FJP","user":{"login":"patriknw","id":336161,"node_id":"MDQ6VXNlcjMzNjE2MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/336161?v=4","gravatar_id":"","url":"https://api.github.com/users/patriknw","html_url":"https://github.com/patriknw","followers_url":"https://api.github.com/users/patriknw/followers","following_url":"https://api.github.com/users/patriknw/following{/other_user}","gists_url":"https://api.github.com/users/patriknw/gists{/gist_id}","starred_url":"https://api.github.com/users/patriknw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patriknw/subscriptions","organizations_url":"https://api.github.com/users/patriknw/orgs","repos_url":"https://api.github.com/users/patriknw/repos","events_url":"https://api.github.com/users/patriknw/events{/privacy}","received_events_url":"https://api.github.com/users/patriknw/received_events","type":"User","site_admin":false},"labels":[{"id":92390779,"node_id":"MDU6TGFiZWw5MjM5MDc3OQ==","url":"https://api.github.com/repos/akka/akka/labels/2%20-%20pick%20next","name":"2 - pick next","color":"207de5","default":false},{"id":37797348,"node_id":"MDU6TGFiZWwzNzc5NzM0OA==","url":"https://api.github.com/repos/akka/akka/labels/needs-attention","name":"needs-attention","color":"e10c02","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":25,"created_at":"2017-03-14T18:40:43Z","updated_at":"2018-12-07T12:58:10Z","closed_at":"2017-03-16T21:25:39Z","author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/akka/akka/pulls/22560","html_url":"https://github.com/akka/akka/pull/22560","diff_url":"https://github.com/akka/akka/pull/22560.diff","patch_url":"https://github.com/akka/akka/pull/22560.patch"},"body":"Scala 2.12 is using the ForkJoinPool (FJP) in the Java library instead of its embedded FJP that was used in Scala 2.11.\r\n\r\nDue to the changed spinning behavior JDK FJP we need to embed it in Akka to avoid performance regression when using Scala 2.12. This PR compares the alternatives.\r\n\r\na) Use standard JDK8 FJP\r\nb) Embed the FJP from Scala 2.11\r\nc) Embed the FJP from latest JDK8 and make the SPINS configurable with changed default\r\n\r\nThis is the results of running\r\n```\r\njmh:run -prof gc -i 7 -wi 3 -f2 -t1 akka.actor.ForkJoinActorBenchmark\r\n```\r\n\r\nScala version 2.12.1\r\n\r\n```\r\n* Scala 2.11 embedded FJP, PL_SPINS 1 << 8 = 256\r\n\r\n[info] Benchmark                                                 (threads)  (tpt)   Mode  Cnt         Score        Error  Units\r\n[info] ForkJoinActorBenchmark.pingPong                                   1      5  thrpt   14   2159411.957 ± 107154.000  ops/s\r\n[info] ForkJoinActorBenchmark.pingPongLessActorsThanCores                1      5  thrpt   14   4399556.360 ±  96535.072  ops/s\r\n[info] ForkJoinActorBenchmark.pingPongMoreActorsThanCores                1      5  thrpt   14   7442406.961 ± 517558.263  ops/s\r\n[info] ForkJoinActorBenchmark.pingPongSameNumberOfActorsAsCores          1      5  thrpt   14  10091710.239 ± 875569.092  ops/s\r\n\r\n* JDK8 1.8.0_45\r\n\r\n[info] Benchmark                                                 (threads)  (tpt)   Mode  Cnt        Score        Error  Units\r\n[info] ForkJoinActorBenchmark.pingPong                                   1      5  thrpt   14  2449423.705 ±  31398.644  ops/s\r\n[info] ForkJoinActorBenchmark.pingPongLessActorsThanCores                1      5  thrpt   14  3370370.415 ± 182461.940  ops/s\r\n[info] ForkJoinActorBenchmark.pingPongMoreActorsThanCores                1      5  thrpt   14  7659857.419 ± 145954.255  ops/s\r\n[info] ForkJoinActorBenchmark.pingPongSameNumberOfActorsAsCores          1      5  thrpt   14  9119127.272 ± 357814.214  ops/s\r\n\r\n* JDK8 1.8.0_121\r\n\r\n[info] Benchmark                                                 (threads)  (tpt)   Mode  Cnt        Score         Error  Units\r\n[info] ForkJoinActorBenchmark.pingPong                                   1      5  thrpt   14   737515.687 ±   21052.658  ops/s\r\n[info] ForkJoinActorBenchmark.pingPongLessActorsThanCores                1      5  thrpt   14  1696908.385 ±  189594.602  ops/s\r\n[info] ForkJoinActorBenchmark.pingPongMoreActorsThanCores                1      5  thrpt   14  7599173.066 ±  176609.141  ops/s\r\n[info] ForkJoinActorBenchmark.pingPongSameNumberOfActorsAsCores          1      5  thrpt   14  7711457.961 ± 2182546.169  ops/s\r\n\r\nMuch system time (red) in CPU graph\r\n\r\n* JDK8 embedded FJP\r\n\r\n[info] Benchmark                                                 (threads)  (tpt)   Mode  Cnt        Score        Error   Units\r\n[info] ForkJoinActorBenchmark.pingPong                                   1      5  thrpt   14   740431.525 ±  34926.540   ops/s\r\n[info] ForkJoinActorBenchmark.pingPongLessActorsThanCores                1      5  thrpt   14  1545063.752 ± 334839.991   ops/s\r\n[info] ForkJoinActorBenchmark.pingPongMoreActorsThanCores                1      5  thrpt   14  7187963.741 ± 288741.096   ops/s\r\n[info] ForkJoinActorBenchmark.pingPongSameNumberOfActorsAsCores          1      5  thrpt   14  6514971.042 ± 411020.259   ops/s\r\n\r\nMuch system time (red) in CPU graph\r\n\r\n* JDK8 embedded FJP, SPINS = 256 via System.property\r\n\r\n[info] Benchmark                                                 (threads)  (tpt)   Mode  Cnt        Score        Error  Units\r\n[info] ForkJoinActorBenchmark.pingPong                                   1      5  thrpt   14  2369275.701 ±  67046.778  ops/s\r\n[info] ForkJoinActorBenchmark.pingPongLessActorsThanCores                1      5  thrpt   14  3172632.872 ± 292650.715  ops/s\r\n[info] ForkJoinActorBenchmark.pingPongMoreActorsThanCores                1      5  thrpt   14  7012919.731 ± 410348.641  ops/s\r\n[info] ForkJoinActorBenchmark.pingPongSameNumberOfActorsAsCores          1      5  thrpt   14  9057492.854 ± 398345.715  ops/s\r\n\r\n* JDK8 embedded FJP, SPINS = 1024 via System.property\r\n\r\n[info] Benchmark                                                 (threads)  (tpt)   Mode  Cnt        Score        Error  Units\r\n[info] ForkJoinActorBenchmark.pingPong                                   1      5  thrpt   14  2392845.452 ±  83381.407  ops/s\r\n[info] ForkJoinActorBenchmark.pingPongLessActorsThanCores                1      5  thrpt   14  2994714.862 ± 199585.794  ops/s\r\n[info] ForkJoinActorBenchmark.pingPongMoreActorsThanCores                1      5  thrpt   14  7255077.354 ± 174069.964  ops/s\r\n[info] ForkJoinActorBenchmark.pingPongSameNumberOfActorsAsCores          1      5  thrpt   14  8832450.775 ± 228266.915  ops/s\r\n\r\n* JDK8 embedded FJP, SPINS = 2048 via System.property\r\n\r\n[info] Benchmark                                                 (threads)  (tpt)   Mode  Cnt        Score        Error   Units\r\n[info] ForkJoinActorBenchmark.pingPong                                   1      5  thrpt   14  2348749.342 ± 105482.838   ops/s\r\n[info] ForkJoinActorBenchmark.pingPongLessActorsThanCores                1      5  thrpt   14  3293309.130 ± 135193.674   ops/s\r\n[info] ForkJoinActorBenchmark.pingPongMoreActorsThanCores                1      5  thrpt   14  7372275.522 ± 260999.817   ops/s\r\n[info] ForkJoinActorBenchmark.pingPongSameNumberOfActorsAsCores          1      5  thrpt   14  9088788.250 ± 262135.111   ops/s\r\n\r\n````\r\n\r\nThe CPU graph is interesting when using latest JDK8 FJP. First part with standard JDK 1.8.0_121, the second part with embedded Scala 2.11 FJP.\r\n\r\n![fjp-cpu](https://cloud.githubusercontent.com/assets/336161/23916864/d85754c4-08ed-11e7-8f69-1859ef144799.png)\r\n"},"comment":{"url":"https://api.github.com/repos/akka/akka/issues/comments/445225245","html_url":"https://github.com/akka/akka/pull/22560#issuecomment-445225245","issue_url":"https://api.github.com/repos/akka/akka/issues/22560","id":445225245,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NTIyNTI0NQ==","user":{"login":"patriknw","id":336161,"node_id":"MDQ6VXNlcjMzNjE2MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/336161?v=4","gravatar_id":"","url":"https://api.github.com/users/patriknw","html_url":"https://github.com/patriknw","followers_url":"https://api.github.com/users/patriknw/followers","following_url":"https://api.github.com/users/patriknw/following{/other_user}","gists_url":"https://api.github.com/users/patriknw/gists{/gist_id}","starred_url":"https://api.github.com/users/patriknw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patriknw/subscriptions","organizations_url":"https://api.github.com/users/patriknw/orgs","repos_url":"https://api.github.com/users/patriknw/repos","events_url":"https://api.github.com/users/patriknw/events{/privacy}","received_events_url":"https://api.github.com/users/patriknw/received_events","type":"User","site_admin":false},"created_at":"2018-12-07T12:58:10Z","updated_at":"2018-12-07T12:58:10Z","author_association":"MEMBER","body":"We want to remove the embedded version in Akka 2.6, if performance is acceptable."}}
{"actor":{"display_login":"patriknw"}}