Core concept

import scala.collection.parallel.CollectionConverters._
(1 to 1000000).par.map(_ * 2).sum
Advertisement

How it works

Overhead for tiny work. Side-effect ordering unpredictable.

Advertisement

Trade-offs + gotchas

CPU-bound work on large collections.