I won’t claim to be an expert in Akka performance, and hopefully someone more experienced will contribute and maybe correct where I make a mistake or two here.
First, as mentioned before, Akka does have overhead. You’re paying a bit of a premium for Akka’s safety protections, things like supervision, as well as the message-passing and mailbox model. In exchange you get those safety protections, things like actor restarting and such, you also gain the flexibility of things like Akka Cluster which can help you distribute your workload across more nodes almost seamlessly. The shortest answer is, Akka takes longer because it’s doing more.
That said, your test is probably not large enough to make a meaningful benchmark, at only 100 events. That’s not likely to be enough time for HotSpot to start optimizing.
Finally there are a few oddities in your akka test code that might be making it a bit unfair.
On line 59 of EmsManagerBehavior.java, you request a watch on the router, within the loop, for every single alarm. (incidentally, as you are the parent of the router, IIRC you’re automatically watching it anyway). Also you don’t seem to do anything with the watch.
I feel like you’re misusing the router concept a bit there, having it create 100 workers that each will only serve one message. As a general guideline, Akka thinks of a worker actor behind a router as an agent that can have work sent to it repeatedly, the role of the router is to distribute that work evenly (or following a different strategy if desired). Creating each of those worker actors is more expensive than just assembling an object, as the workers have to have mailboxes created, and sending messages to them requires extra logic for which one to send to, when connected to a router like that.
There’s a few other places where you seem to be simply doing more work in the Akka side, but without doing a deeper dive than I have the time for, I can’t pick into those too much.
As a final piece of advice, for the kind of workload you seem to be trying to perform: an incoming stream or batch of events to process, you may want to look more at Akka Streams than Akka actors. Akka streams is focused on throughput while managing memory resources through backpressure, and can still perform tasks in parallel. Still, nothing a framework does will ultimately execute faster than carefully assembled, purpose-built code, what it might be is faster to write, easier to understand, or safer.