Hi, I got this fairly simple actor:

private def actor(state: Option[R], calc: () => Future[R]): 
Actor.Immutable[Message] = Actor.immutable[Message] {
  (_, msg) =>
    msg match {
      case Get(replyTo) =>
        state match {
          case Some(f) =>
            replyTo ! f
            Actor.same
          case None =>
            val f = calc().awaitFor(maxWaitForFuture)
            replyTo ! f
            actor(Some(f), calc)
        }
      case Flush =>
        actor(None, calc)
    }
}


There is a blocking calc().awaitFor call, but that's not my concern right 
now. The actual calc returns a Future that just increases an integer, 
nothing more.

I have a test case for it where I send it 400 Get(--) messages using the 
ask pattern, i.e. actor ? Get(_) . It takes 5 seconds for the test to run. 
This seems too long for me. My calc() method just increases an integer (it 
is just a test).
More weirdly when I increase the messages to 800, the time it takes is 
above 20 secs!!!

I did a bit of profiling, 45% of the time is spend on
akka.actor.LightArrayRevolverScheduler$$anon$4.nextTick()

I saw the src code and it seems it sleeps a bit there conditionally.

How can I debug this slowness?

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to