Search code examples
scalascala-2.9parallel-collections

ParVector map is not running in parallel


I have a bit of code like:

val data = List(obj1, obj2, obj3, obj4, ...).par.map { ... }

and the ParVector is roughly 12 elements large. I noticed that all of my work is being done in the main thread so I traced down the stacktrace and found that in the following line (in the link below), ifParallel is false (from CanBuildFrom). Any hints as to why it's false, and what I can do to help it?

https://github.com/paulp/scala-full/blob/2.9.0.1/src/library/scala/collection/parallel/ParIterableLike.scala#L504


Solution

  • There was an error in the version of scala I was using. It has since been fixed.