Strange Behaviour Using Scala Parallel Collections and setParallelism
问题 I recently found out about Parallel Collection in Scala 2.9 and was excited to see that the degree of parallelism can be set using collection.parallel.ForkJoinTasks.defaultForkJoinPool.setParallelism. However when I tried an experiment of adding two vectors of size one million each , I find Using parallel collection with parallelism set to 64 is as fast as sequential (Shown in results). Increasing setParallelism seems to increase performance in a non-linear way. I would have atleast expected