简体   繁体   English

scala / akka性能与java 7 fork / join

[英]scala/akka performance versus java 7 fork/join

I am new to Scala/Akka, although I am very well familiar with the concept of actor-based modeling. 我是Scala / Akka的新手,虽然我非常熟悉基于actor的建模概念。 I am trying to parallelize an existing code for better performance, and I have two versions: one in Scala/Akka and one in Java 7's ForkJoinPool. 我试图并行化现有代码以获得更好的性能,我有两个版本:一个在Scala / Akka中,一个在Java 7的ForkJoinPool中。

I was expecting that the actor-based approach should be faster, but the result is the other way round. 我期待基于演员的方法应该更快,但结果却相反。 It is something like 20 sec for Scala/Akka versus 17 sec for Java fork/join. Scala / Akka的时间为20秒,而Java fork / join则为17秒。

I'd like to know if akka is intrinsically slower? 我想知道akka本质上是否较慢? Or could it be because I am using the classes from the existing code written in normal Java in my both implementations? 或者可能是因为我在我的两个实现中使用普通Java编写的现有代码中的类?

Akka is using the ForkJoinPool in some of its implementations of its Actors framework (See Java 7 ForkJoinTask and Akka 2.0 ), so it is expected to be slower when running. Akka在其Actors框架的一些实现中使用了ForkJoinPool(参见Java 7 ForkJoinTask和Akka 2.0 ),因此运行时预计会更慢。 In opposition, its made to be easier to work with on the developer side, you choose which side you prefer: development speed or running speed! 相反,它在开发人员方面更易于使用,您可以选择您喜欢哪一方:开发速度或运行速度!

For the second question you might want to split it into another SO question. 对于第二个问题,您可能希望将其拆分为另一个SO问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM