News for hackers. Stuff that matters.
Re:Rust and Go by jbooth on Saturday November 08, 2014 @12:41AM (#8576146)
Amdahl's law says auto-parallelising a map operation is usually a big waste of time.
Re:Rust and Go by codygman on Saturday November 08, 2014 @01:03AM (#8576182)
Who is Amdahl, why should I care, and does he expand on this argument or is it your interpretation of a more generalized law?

Going to search for it, but I'd still like to hear your response.

Re:Rust and Go by masklinn on Saturday November 08, 2014 @03:19AM (#8576338)
The application in this case is that the mapped operation generally has a fairly low cost and the (sequential) cost of dispatching and resynchronising back into a result are going to dwarf any gain you'd get unless either the collection is huge (and the parallelization is coarsely chunked) and/or the mapped operation is extremely expensive.

Same reason why even though mergesort is fairly trivially parallelizable there's basically no stdlib running parallel mergesorts by default: you need huge collections before you recoup the synchronization overhead.

Re:Rust and Go by SamReidHughes on Saturday November 08, 2014 @03:54AM (#8576387)
Your collections don't have to be stupifyingly huge for a parallel mergesort to be faster. It's bad for a standard library to auto-parallelize because that's an unwelcome side effect. If you're writing some program where you actually cared about the performance speedup, in most cases having a sort function spawn threads or use threads behind your back in a way that your system can't control is completely unwelcome.
Re:Rust and Go by jacques_chester on Saturday November 08, 2014 @08:19AM (#8576777)
Have you rung up the GPU manufacturers to tell them that they're wasting everyone's time?
Re:Rust and Go by dbaupp on Saturday November 08, 2014 @07:23PM (#8578626)
The synchronisation/set-up overheads are still fairly large (e.g. communicating with the GPU). I find it rather unlikely that e.g. a map over 20 elements will be faster in parallel.
Re:Rust and Go by jacques_chester on Sunday November 09, 2014 @10:55AM (#8580100)
It might not be. But I am happy to ignore the question and leave it to the compiler or runtime to take advantage of easy parallelism. Maps allow that, loops (or any other sequential treatment of data) doesn't.

My personal brand of bigotry is relational databases, so I am accustomed to thinking of sorted / ordered behaviour as the special case. Thinking in sets is very powerful.

It doesn't have to be either/or. Sometimes you need a loop. But it would be nice to have mapping too.