Scala, Akka and Erlang Actor Benchmarks

Since i am currently intrigued by Erlang for a special project, i thought i look into Actor Performance. I found an interesting Post by Paul Keeble comparing Erlang with Scala Actors. I also found an Akka-Benchmark, but it was outdated and i thought i give 2.0-SNAPSHOT a go.

Here are my results:

Erlang

Erlang R14B04 (erts-5.8.5) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [hipe]

Eshell V5.8.5  (abort with ^G)
1> client:runTest(12000000)
Count is {ok,1200000000}
Test took 26.506394 seconds
Throughput=452720.95480056625 per sec
ok
2> client:runTest2(12000000).
Count is 1200000000
Test took 11.322672 seconds
Throughput=1059820.5087986297 per sec
ok

Roughly about 1 million messages per second, not bad!

Scala and Akka

Starting Akka...
Running Akka 2.0-SNAPSHOT
Deploying file:/usr/local/akka/deploy/scalavserlang_2.9.1-1.0.jar
[INFO] [12/25/2011 17:49:54.560] [main] [ActorSystem] REMOTE: RemoteServerStarted@akka://AkkaTest@127.0.0.1:2552
[INFO] [12/25/2011 17:49:54.572] [main] [Remote] Starting remote server on [akka://AkkaTest@127.0.0.1:2552]
Starting up ag.bett.scala.test.akka.AkkaActorKernel
[akka] Count is 1200000000
[akka] Test took 5.596 seconds
[akka] Throughput=2144388.849177984 per sec
--
[scala] Count is 1200000000
[scala] Test took 21.696 seconds
[scala] Throughput=553097.3451327434 per sec

WOW! Look at that result! Akka made 2.1 Million per second. Looks like Akka 2.0 seems to be a keeper!

I am looking forward to using Akka 2.0 together with my favourite Web-Framework Liftweb

UPDATE LiftActor

Since this post has gotten very much attention, i thought for completeness, i'll add LiftActor to the Benchmark. It performs still better than the Scala Actors, but not as good as Akka. They're close to Erlang i'd say.

Starting Akka...
Running Akka 2.0-SNAPSHOT
Deploying file:/usr/local/akka-2.0-M1/deploy/scalavserlang_2.9.1-1.0.jar
Starting up ag.bett.scala.test.lift.ActorKernel
[lift] Count is 1200000000
[lift] Test took 13.009 seconds
[lift] Throughput=922438.3119378891 per sec

Do it yourself

Since i tested it on one of my VPS with 2GB RAM, i am quite sure that there is a lot more behind Akka where that result came from. So if you want, give it a try. I've forked the original repository of Paul Keeble into my own.

You can find everything in the designated GitHub repo, i've taken the liberty of packaging akka-2.0-SNAPSHOT jars together with sbt for easy compilation/running.

Since you might be using a different git revision than i do (e160179aa91c54284c301a7bea64f96c681f3610), you might want to replace those jars.

[UPDATE] I also updated the Repo so it has an AkkaKernel for each Test-Actor.

Simply copy the .jar to your akka's deploy/ and run:

./bin/akka ag.bett.scala.test.akka.ActorKernel
./bin/akka ag.bett.scala.test.lscala.ActorKernel
./bin/akka ag.bett.scala.test.lift.ActorKernel

Thanks to everyone at Typesafe and Akka for this present!

Have fun and merry christmas!

Flattr me!

Tell your friends!