equal
deleted
inserted
replaced
7 // |
7 // |
8 // scala mandelbrot.sc |
8 // scala mandelbrot.sc |
9 // |
9 // |
10 // Or inside the REPL with |
10 // Or inside the REPL with |
11 // |
11 // |
12 // scala --extra-jars scala-parallel-collections_3-1.0.4.jar |
12 // scala --extra-jars scala-parallel-collections_3-1.2.0.jar |
13 // |
13 // |
|
14 |
|
15 |
|
16 |
14 // !! UPDATE ON TIMING: On my faster Mac-M1 machine |
17 // !! UPDATE ON TIMING: On my faster Mac-M1 machine |
15 // !! the times for the first example are ca. 4 secs for |
18 // !! the times for the first example are ca. 4 secs for |
16 // !! the sequential version and around 0.7 secs for the |
19 // !! the sequential version and around 0.7 secs for the |
17 // !! par-version. |
20 // !! par-version. |
18 |
21 |
19 // for parallel collections |
22 // for parallel collections |
20 //> using dep org.scala-lang.modules::scala-parallel-collections:1.0.4 |
23 //> using dep org.scala-lang.modules::scala-parallel-collections:1.2.0 |
21 import scala.collection.parallel.CollectionConverters.* |
24 import scala.collection.parallel.CollectionConverters.* |
22 |
25 |
23 // for graphics |
26 // for graphics |
24 import javax.swing.{JFrame, JPanel, WindowConstants} |
27 import javax.swing.{JFrame, JPanel, WindowConstants} |
25 import java.awt.{Color, Dimension, Graphics, Graphics2D} |
28 import java.awt.{Color, Dimension, Graphics, Graphics2D} |