diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/benchmarks/src/scala/collection/parallel/Benchmarking.scala | 1 | ||||
-rw-r--r-- | test/benchmarks/src/scala/collection/parallel/benchmarks/generic/ParallelBenches.scala | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/test/benchmarks/src/scala/collection/parallel/Benchmarking.scala b/test/benchmarks/src/scala/collection/parallel/Benchmarking.scala index 954ee727a0..63a5de36ee 100644 --- a/test/benchmarks/src/scala/collection/parallel/Benchmarking.scala +++ b/test/benchmarks/src/scala/collection/parallel/Benchmarking.scala @@ -77,6 +77,7 @@ trait BenchmarkRegister { register(parallel_view.DummyViewBenchList.IterationM) register(parallel_view.DummyViewBenchList.IterationA) register(parallel_view.DummyViewBenchList.IterationZ) + register(parallel_view.DummyViewBenchList.IterationP) // parallel ranges register(parallel_range.RangeBenches.Reduce) diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/generic/ParallelBenches.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/generic/ParallelBenches.scala index 8516b77191..e99c70d921 100644 --- a/test/benchmarks/src/scala/collection/parallel/benchmarks/generic/ParallelBenches.scala +++ b/test/benchmarks/src/scala/collection/parallel/benchmarks/generic/ParallelBenches.scala @@ -62,6 +62,7 @@ self => } trait SeqBench extends IterableBench { + def seqcollAsSeq = seqcoll.asInstanceOf[Seq[T]] override def createSequential(sz: Int, p: Int) = self.createSequential(sz, p) } @@ -219,6 +220,26 @@ self => def companion = IterationZ } + object IterationP extends SeqBenchCompanion { + override def defaultSize = 50000 + def benchName = "iter-p" + def apply(sz: Int, p: Int, w: String) = new IterationP(sz, p, w) + } + + class IterationP(val size: Int, val parallelism: Int, val runWhat: String) + extends SeqBench with SeqViewBench { + val patch = operators.sequence(size / 4) + val sqpatch = patch.toSeq + def comparisonMap = collection.Map("seqview" -> runseqview _) + def runseq = { + val withpatch = this.seqcollAsSeq.patch(size / 4, sqpatch, size / 2) + withpatch.foreach(operators.eachFun) + } + def runpar = this.parcoll.patch(size / 4, patch, size / 2).foreach(operators.eachFun) + def runseqview = this.seqview.patch(size / 4, patch, size / 2).foreach(operators.eachFun) + def companion = IterationP + } + object Reduce extends SeqBenchCompanion { override def defaultSize = 50000 def benchName = "reduce"; |