I don't understand why more people aren't using Rhino. Or are they just not taking that survey? Doesn't anyone else see the beauty in scripting with js, with all the power of the jvm?
It's too late for that. Scala's community has been branded as a bunch of condescending intellectuals. Just like Ruby's community was branded as a bunch of pierced, macbook users in 2005. Neither are really true -- but first impressions mean everything.
That does not say much, without actually specifying how much data is processed. It's great if you can spread calculations among 8 cores, but if a single-threaded C process provides better performance (let alone a parallel C implementation), what does it say?
Could you provide more data points?
(By the way, in C such loops can typically be parallelized by adding one OpenMP pragma.)
> if a single-threaded C process provides better performance (let alone a parallel C implementation), what does it say?
It doesn't say much until you define what's most important to you. Is it more important that you can use Scala and get your code working more quickly or do you have more time to write and debug a C program and do you really need to do that for performance reasons? Does the code need to function as part of a larger Java/Scala or C application, etc. In other words, and as always, you need to pick to right tool for the job.
The JVM is very fast now days, in my work the issue of performance vs. C never comes up. Obviously there are still valid uses for C these days, but you can get very decent performance from the JVM and that often means you can finish your work faster.
I've found that if the list is very large, using
list.par.map(...)
hits the memory limit & then simply hangs.
I process upwards of a million facilities ( a facility is the exposure on a commercial loan a bank makes to a client ), trying to forecast their expected loss over 12 future quarters.
I rewrote my code like so :
val facs:List[Facility] = ...populated via jdbc query ///
val N = 1000
facs.grouped(N).foreach( group => {
group.par.map( fac => expectedloss(fac)
})
Now the outer loop is sequential but the inner loop is parallel. It chugs along, and processes the entire million plus facilities! I get some control via the N. Currently my N is 1000 and all 8 cores running at 100% capacity, but I can slow down the workload with smaller N.
You've gotta manage your expectations properly. Vim takes time to learn. Trust that there's a payoff, be patient. I'd like to think my first attempt at becoming a Vim user stuck, but I took it slow. I was using Vim at my day job, and it went something like this:
1 month - really started to feel a productivity increase over text editing in an IDE
3 months - started to feel like I was flying
6 months - began desperately searching for Vim plugins for Eclipse