--- a/progs/lecture1.scala Wed Aug 07 14:32:21 2019 +0100
+++ b/progs/lecture1.scala Wed Aug 07 16:15:42 2019 +0100
@@ -472,6 +472,16 @@
time_needed(10, for (n <- list) yield n + 42)
time_needed(10, for (n <- list.par) yield n + 42)
+val list = (1 to 1000000).toList.map(BigInt(_))
+list.sum
+list.par.sum
+list.par.reduce(_ + _)
+list.par.aggregate(BigInt(0))(_ + _, _ + _)
+
+time_needed(10, list.sum)
+time_needed(10, list.par.sum)
+time_needed(10, list.par.reduce(_ + _))
+time_needed(10, list.par.aggregate(BigInt(0))(_ + _, _ + _))
// Just for "Fun": Mutable vs Immutable