Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 293
Mahdi Avatar asked Aug 21 '12 11:08

Mahdi


1 Answers

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.

like image 67
jolivier Avatar answered Oct 19 '22 15:10

jolivier