« Return to Thread: [scala] Scala Actors - no speedup?

Re: [scala] Scala Actors - no speedup?

by Martin Probst-2 :: Rate this Message:

Reply to Author | View in Thread

Thanks for the responses.

So the machine is indeed a dual core MacBook Pro 2.0 GHz, forgot to mention
that.

When I run it using 'time' on ~250 MB, it says that I spend nearly no time
in sys, all just user. Looking at the actual CPU utilization (using
MenuMeters) doesn't really tell me anything. In the (supposedly) single
threaded case, one CPU gets some limited use, and one is pegged. In the
Actors case, both CPUs appear to be busy - but I don't really trust that
tool, to be honest.

I hoped someone could tell me how/where to find out how many threads are
being used. I'm using 'react' and not 'receive', and 'react' is - according
to the actors tutorial - not forcing the actor to use a single thread. So
maybe they are using none at all?

On the other hand, increasing the number of actors beyond my number of
cores, e.g. to 32, doesn't harm performance significantly, which might mean
it's not working at all or the actor-based concurrency has very limited
overhead, which is of course good :-)

Regards,
Martin

On Tue, 25 Sep 2007 09:05:11 -0700, David Pollak <dpp@...> wrote:
> Sorry... should have read your blog post...
>
> The first problem is your hardware... the hard drive in the MacBook Pro
> is a dog.
>
> The second problem is your OS... the Mach Kernel is notoriously bad for
> doing IO... Linus has an occasional rant about this.  My MacBook Pro has
> something like 1/2 the disk read performance of my ThinkPad T41 running
> Ubuntu (same disk rotation speed and the TPad has an IDE drive, not
SATA.)

>
> My guess is that you're spending nearly a whole CPU doing disk IO... you
> might try a larger file and see how much of your time is spent in System
> vs. User.
>
> David Pollak wrote:
>> How many cores in your machine?
>>
>> Martin Probst wrote:
>>> Hi,
>>>
>>> I tried to implement Tim Bray's Wide Finder proposal
>>> (http://www.tbray.org/ongoing/When/200x/2007/09/20/Wide-Finder) in
>>> Scala,
>>> using Actors. The code is here:
>>> http://www.martin-probst.com/2007/09/24/wide-finder-in-scala/
>>>
>>> Basically, it's about parsing a log file using regular expressions.
>>> In my
>>> code, I have one coordinator who reads the log file and sends work
>>> chunks
>>> to several analyzers, and the combines their work again.
>>>
>>> As I write there, I don't see any speedup when running the code using
>>> Actors in comparison with the serial version. Any ideas? Am I doing
>>> something wrong?
>>>
>>> Is there any way to specify the number of threads that should be used
>>> for
>>> Actor execution?
>>>
>>> Regards,
>>> Martin
>>>
>>>
>>

 « Return to Thread: [scala] Scala Actors - no speedup?