diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-07-16 13:06:38 +1000 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2015-07-15 22:32:43 -0700 |
commit | a2973dfd954c0c094f956becb05a82bee5f7da01 (patch) | |
tree | 2135ee1616ff3920d00c35046be2037af9aa3a3f /test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ScanMedium.scala | |
parent | fa8012d28687986902ce1255a19f9f49affb3bca (diff) | |
download | scala-a2973dfd954c0c094f956becb05a82bee5f7da01.tar.gz scala-a2973dfd954c0c094f956becb05a82bee5f7da01.tar.bz2 scala-a2973dfd954c0c094f956becb05a82bee5f7da01.zip |
Remove further references to forkjoin
Use j.u.c.Forkjoin directly in active and disabled tests
Remove bitrotted benchmarks code
I was going to update these to use `java.util.concurrent.ForkJoin`
directly, instead of our deprecated stubs.
But most of them don't compile anymore (e.g. scala.testing.Benchmark
has been removed, ClassTag imports missing).
While I'm all for benchmarks, we should have large swathes of code
checked in that isn't at compiled and run automatically.
I'm happy to help someone resurrect these in a suitable form.
Diffstat (limited to 'test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ScanMedium.scala')
-rw-r--r-- | test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ScanMedium.scala | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ScanMedium.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ScanMedium.scala deleted file mode 100644 index a60ba7aa33..0000000000 --- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ScanMedium.scala +++ /dev/null @@ -1,55 +0,0 @@ -package scala.collection.parallel.benchmarks.parallel_array - - -import scala.collection.parallel.benchmarks._ -import scala.collection.parallel.mutable.ParArray - - -object ScanMedium extends Companion { - def benchName = "scan-medium"; - def apply(sz: Int, parallelism: Int, what: String) = new ScanMedium(sz, parallelism, what) - override def comparisons = List("jsr") - override def defaultSize = 5000 - - val op = (a: Cont, b: Cont) => { - operation(a, b) - } - def operation(a: Cont, b: Cont) = { - val m = if (a.in < 0) 1 else 0 - val k = calc(a.in, b.in, m) - new Cont(a.in + b.in + k * m * (0 until 2).reduceLeft(_ + _)) - } - private def calc(x: Int, y: Int, n: Int) = { - var sum = x - for (i <- 0 until 500) { - sum += y + (if (sum % 2 == 0) n * x else y) - if (sum % 5 == 0) sum -= x * y - n * (x + y) - } - sum - } -} - - -class ScanMedium(sz: Int, p: Int, what: String) -extends Resettable[Cont](sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont]) { - def companion = ScanMedium - override def repetitionsPerRun = 50 - override val runs = 12 - - def runpar = pa.scan(new Cont(0))(ScanMedium.op) - def runseq = sequentialScan(new Cont(0), ScanMedium.op, sz) - def runjsr = jsrarr.cumulate(new extra166y.Ops.Reducer[Cont] { - def op(a: Cont, b: Cont) = ScanMedium.operation(a, b) - }, new Cont(0)) - override def comparisonMap = collection.Map("jsr" -> runjsr _) -} - - - - - - - - - - |