[akka-user] Re: akka actor - performance issue

2015-07-15 Thread flydaf
I have got 4 cores/threads machine.
I am running one experiment in one actor.
Requirement for program is to run as much experiments as it's possible 
concurrently.Number of experiments must be parametrised.

-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: akka actor - performance issue

2015-07-14 Thread flydaf
1. Mistake, not 8000k ms , should be 8k ms
2. Mensioned ~13% time difference in perf. time get  bigger with growing 
number of CountingActors.


-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] akka actor - performance issue

2015-07-14 Thread flydaf
Hi everyone!
I working on some scala computing some game theory problem using Akka.
Basically I've got three types involved :
1. ComputingActor - does the job, running 1 actor for 1 experiment
2. ResultsActor - collects results from computing actors and sends to 
JobScheduler when job's done
3. JobScheduler - not actor type - it takes all results from ResultsActor 
using '?' tell and Await.result()

In ComputingActor I've got  some for loop which runs 50 times, core 
computations are done there.

for(i - 1 to basicParams.getNoOfSeas) {  
  strgEval.evaluate //my computation


I've done some performance tests and turns out that one thread program is 
faster ~13% (40k ms to 46k ms)
What I've noticed is that when I increase number of experiments (means more 
actors running) time spent in this for loop is longer.
So I commented out my computation in for loop and set loop like this one to 
check if my computation code is responsible for that.

//for(j - 0 to 1000) {
//  var z = j*2
//}

It does nothing, just keep busy CPU, but tendency is same.
I don't  have a good idea what might be the problem, bad design?Is it 
something that I missed?
I've checked execution with profiler, it seams threads're working good(no 
bloking).
Is fork-join-dispatcher working like that?
I mean, it seams that work is scheduled from other ComputingActor instances 
on different threads.
First actor ends computations in 38k ms and others soon after him, but in 
single threaded version it takes only 8000k ms using my computation code.
In that case multithreaded program doesn't give any additional performance 
value. :/

Will appreciate any hints.

PS. I also cheked it on coomon java thread version of program. If  I spawn 
more threads I've got longer in that loop.

-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Actors performance program

2015-04-27 Thread flydaf
Hi,
I've got a program using actors for parallel computations.
I'd like to know it's performance considering number of threads using 
during computations(and maybe optimize it).
What tools would u suggest to check that?How to bite it?

-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Actors program performance

2015-04-27 Thread flydaf
Hi,
I've got a program which uses actors(akka) for parallel computations.
I'd like to know it's performance considering thread using (to know need of 
optimization).
What tools are proper for it?Which would you recommend?

-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Collecting messages from many actors in non-actor

2014-03-16 Thread flydaf
Hi,
I am new in Akka.
Here's situation.
I am writing program which computes some math problem.
1 Experiment is computed by 1 EvaluationActor
No. of experiments might be thousands,or hundreds of thousends, even more.
Each EvaluationActor has child actor - ResultActor which collects stats 
from experiment.
Now, I have EvaluationScheduler type(which's non-actor) and want to collect 
stats from all experiments to show it.
According to documentation I should use Inbox class to be able to get multi 
replies from ResultActors.
Here's some test code for Inbox usage : 

def InboxTest = {
implicit val as = ActorSystem()

val a = actor(new Act {
  become {
case hello ⇒ sender ! hi
case hello1 ⇒ sender ! hi1
case hello2 ⇒ sender ! hi2
  }
})

implicit val i = inbox()
a ! hello
a ! hello2
a ! hello1

i.receive().asInstanceOf[String].foreach(print _)
print(\n)
i.receive().asInstanceOf[String].foreach(print _)
print(\n)
i.receive().asInstanceOf[String].foreach(print _)
print(\n)

The code is rough, but my thought was to show that I have to call receive() 
each time I want get next message.
Since I can't get mailboxsize will be tricky to know when check for next 
message.

So now, using this I need to build some mechanism to be sure that I have 
all stats from each ResultActor = each experiment.
Simple solution for this is counting received messages and maybe sending 
some experimentID or something.
But this's not solution, because if mailbox will be empty at I got :
java.util.concurrent.TimeoutException: deadline passed

Any better ideas/propositions?
Maybe there's better way more like out of the box in akka for such task?

regards
Darius.

-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.