Hacker News new | ask | show | jobs
by sreque 5396 days ago
I'm surprised that you chose to use actors to parallelize your code. I always thought they were more valuable for concurrency. Back before Scala 2.8 came out with parallel collections, when I need parallelism I wrote my own pmap-like functions. It was really easy, probably easier than learning the whole concept of actors, let alone an implementation of them, and I got the performance speedup I was looking for.

It sounds to me like you got a large code reduction because in Scala you used a heavyweight concurrency solution to a lightweight parallelism problem.

1 comments

I just went back and looked at the code overhead of using actors over what it might look like with 2.9's parallel collections and the difference would be about 25-30 lines so I don't think that counts as a potentially "large code reduction". Wrapping three bits of code in actors doesn't add much ceremony (which is in fact a great example of how concise Scala can be when adding concurrency!).

(And parallel collections came in 2.9, not 2.8 - we'd already migrated, painfully, from 2.7 to 2.8)