savina icon indicating copy to clipboard operation
savina copied to clipboard

Why do the Akka benchmarks use context.system.actorOf?

Open dplyukhin opened this issue 1 year ago • 0 comments

Hi, I've been using the Savina benchmarks to evaluate an Akka feature I'm developing.

I noticed that the Akka benchmarks do not use the most efficient API for spawning actors. Namely, in FibonacciAkkaActorBenchmark, actors are spawned using context.system.actorOf instead of context.actorOf. The former API spawns actors at the top level of the supervision hierarchy, whereas the latter means that the parent supervises the child. I found that switching from the former to the latter led to a 2x performance improvement in Akka 2.6.3!

My theory is that you used the former API to simplify manual actor termination. In Akka, stopping the supervisor causes all its descendants to stop, which can sometimes mean that actors stop earlier than expected.

Is my theory correct? I'd love to hear your thoughts.

dplyukhin avatar Jul 27 '23 17:07 dplyukhin