Performance of message-passing in the Actor model [closed]
Asked Answered
C

2

5

I've seen benchmarks of Actor model implementations done in terms of their actors. For example, Akka actors are very lightweight (600 bytes per actor) and millions of them can be created. However, I've never seen a benchmark done in terms of message-passing throughput.

For example, given some number of actors, how many messages can pass between them per second?

Does anyone have a link to such a performance benchmark (in terms of message-passing throughput)?

Corliss answered 28/7, 2010 at 22:24 Comment(0)
O
3

Here is a benchmark implemented in

  • Akka 0.8.1 (Scala)
  • Scala Actors
  • Jetlang (Java)

Also see Azul Vega 1 + Scala actors and Azul Fast Bytecodes for Funny Languages and this paper.

Omnipotence answered 28/7, 2010 at 22:59 Comment(1)
See the readme in github.com/jboner/akka-benchOmnipotence
L
0

When I ran a performance test with this simple actor built around my implementation of the model it had a 444773.906 message per second throughput. Clearly it is a contrived test but it gives you a general idea of how it might perform in the wild.

private class TestActor : Actor<int, bool>
{
    protected override void ProcessMessage(AsyncReplyPackage<int, bool> package)
    {
        package.ReplyChannel.Send(package.Message > 2000000);
    }
}

static void Main(string[] args)
{
    var r = false;
    using (var ts = new TestActor())
    using (var rc = new AsyncChannel<bool>())
    {
        ts.PostWithAsyncReply(0, rc);
        r = rc.Receive();

        var count = 3000000;
        var sw = Stopwatch.StartNew();
        for (int i = 0; i < count; i++)
        {
            ts.PostWithAsyncReply(i, rc);
            r = rc.Receive();
        }
        Console.WriteLine(sw.Elapsed);
    }
    Console.WriteLine(r);
    Console.ReadLine();           
}

Size

I broke out the profiler and it looks like my implementation is 944 bytes. :(

Latinize answered 28/7, 2010 at 22:37 Comment(1)
I think this question is still very interesting. If anyone has something to contribute... or if there is any tool to monitor scala, akka performance.Louannlouanna

© 2022 - 2024 — McMap. All rights reserved.