Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Scala parallel collections benchmark
// http://docs.scala-lang.org/overviews/parallel-collections/performance.html
import collection.parallel.mutable.ParTrieMap
import collection.parallel.ForkJoinTaskSupport
object Map extends testing.Benchmark {
val length = sys.props("length").toInt
val par = sys.props("par").toInt
val partrie = ParTrieMap((0 until length) zip (0 until length): _*)
partrie.tasksupport = new ForkJoinTaskSupport(new scala.concurrent.forkjoin.ForkJoinPool(par))
def run = {
partrie map {
kv => kv
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment