3 ms·
Here is the magic of Scala. A collection designed for concurrency: val users = List("seanmcdirmid", "mark242").reverse That same collection, designed for par
by mark242 13y ago
Here is the magic of Scala.
A collection designed for concurrency:
val users = List("seanmcdirmid", "mark242").reverse
That same collection, designed for parallelism and concurrency:
val users = List("seanmcdirmid", "mark242").par.reverse
- seanmcdirmid 13y agoThe APIs are equivalent and safe, but parallelism is a feature of opportunity. The overhead of using an immutable collection is often not overcome by the use of parallel threads, making the tradeoff not worth it. Even CUDA has brought mutability back to GPUs for performance reasons.