简体   繁体   中英

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. 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.

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.

I'd like to know if akka is intrinsically slower? Or could it be because I am using the classes from the existing code written in normal Java in my both implementations?

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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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