From 07edcee629fb00808fb695ba4ec68a26f3e99490 Mon Sep 17 00:00:00 2001 From: Aleksandar Pokopec Date: Fri, 7 Jan 2011 12:05:21 +0000 Subject: Changed foreach to pforeach. No review. --- .../parallel/benchmarks/generic/ParallelBenches.scala | 12 ++++++------ .../benchmarks/hashtables/ParallelHashTableSets.scala | 4 ++-- .../parallel/benchmarks/hashtables/ParallelHashTables.scala | 4 ++-- .../parallel/benchmarks/parallel_array/ForeachHeavy.scala | 2 +- .../parallel/benchmarks/parallel_array/ForeachLight.scala | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) (limited to 'test/benchmarks') 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 e99c70d921..c0545aff52 100644 --- a/test/benchmarks/src/scala/collection/parallel/benchmarks/generic/ParallelBenches.scala +++ b/test/benchmarks/src/scala/collection/parallel/benchmarks/generic/ParallelBenches.scala @@ -144,7 +144,7 @@ self => extends SeqBench with SeqViewBench { def comparisonMap = collection.Map("seqview" -> runseqview _) def runseq = this.seqcoll.foreach(operators.eachFun) - def runpar = this.parcoll.foreach(operators.eachFun) + def runpar = this.parcoll.pforeach(operators.eachFun) def runseqview = { this.seqview.foreach(operators.eachFun) } @@ -161,7 +161,7 @@ self => extends SeqBench with SeqViewBench { def comparisonMap = collection.Map("seqview" -> runseqview _) def runseq = this.seqcoll.slice(0, size / 2).foreach(operators.eachFun) - def runpar = this.parcoll.slice(0, size / 2).foreach(operators.eachFun) + def runpar = this.parcoll.slice(0, size / 2).pforeach(operators.eachFun) def runseqview = this.seqview.slice(0, size / 2).foreach(operators.eachFun) def companion = IterationS } @@ -176,7 +176,7 @@ self => extends SeqBench with SeqViewBench { def comparisonMap = collection.Map("seqview" -> runseqview _) def runseq = this.seqcoll.map(operators.mapper).foreach(operators.eachFun) - def runpar = this.parcoll.map(operators.mapper).foreach(operators.eachFun) + def runpar = this.parcoll.map(operators.mapper).pforeach(operators.eachFun) def runseqview = this.seqview.map(operators.mapper).foreach(operators.eachFun) def companion = IterationM } @@ -196,7 +196,7 @@ self => val withapp = this.seqcoll.++(sqappended) withapp.foreach(operators.eachFun) } - def runpar = this.parcoll.++(appended).foreach(operators.eachFun) + def runpar = this.parcoll.++(appended).pforeach(operators.eachFun) def runseqview = this.seqview.++(appended).foreach(operators.eachFun) def companion = IterationA } @@ -215,7 +215,7 @@ self => val withzip = this.seqcoll.zip(zipped) withzip.foreach(operators.eachPairFun) } - def runpar = this.parcoll.zip(zipped).foreach(operators.eachPairFun) + def runpar = this.parcoll.zip(zipped).pforeach(operators.eachPairFun) def runseqview = this.seqview.zip(zipped).foreach(operators.eachPairFun) def companion = IterationZ } @@ -235,7 +235,7 @@ self => 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 runpar = this.parcoll.patch(size / 4, patch, size / 2).pforeach(operators.eachFun) def runseqview = this.seqview.patch(size / 4, patch, size / 2).foreach(operators.eachFun) def companion = IterationP } diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTableSets.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTableSets.scala index 96d75f480f..88640f3644 100644 --- a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTableSets.scala +++ b/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTableSets.scala @@ -91,7 +91,7 @@ trait ParHashTableSetBenches[T] extends StandardParIterableBenches[T, ParHashSet extends IterableBench { def comparisonMap = collection.Map() def runseq = this.seqcoll.foreach(operators.foreachFun) - def runpar = this.parcoll.foreach(operators.foreachFun) + def runpar = this.parcoll.pforeach(operators.foreachFun) def companion = Foreach } @@ -115,7 +115,7 @@ object RefParHashTableSetBenches extends ParHashTableSetBenches[Dummy] { val array = new Array[Int](size) def comparisonMap = collection.Map() def runseq = for (x <- this.seqcoll) array(x.in) += 1 - def runpar = for (x <- this.parcoll) array(x.in) += 1 + def runpar = this.parcoll.pforeach { x => array(x.in) += 1 } def companion = ForeachSet override def onEnd { diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTables.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTables.scala index 94c38b52b1..cf0e53e47d 100644 --- a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTables.scala +++ b/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTables.scala @@ -105,7 +105,7 @@ trait ParHashTableBenches[K, V] extends StandardParIterableBenches[(K, V), ParHa extends IterableBench { def comparisonMap = collection.Map() def runseq = this.seqcoll.foreach(operators.foreachFun) - def runpar = this.parcoll.foreach(operators.foreachFun) + def runpar = this.parcoll.pforeach(operators.foreachFun) def companion = Foreach } @@ -131,7 +131,7 @@ object RefParHashTableBenches extends ParHashTableBenches[Dummy, Dummy] { val array = new Array[Int](size) def comparisonMap = collection.Map() def runseq = for (p <- this.seqcoll) array(p._1.in) += 1 - def runpar = for (p <- this.parcoll) array(p._1.in) += 1 + def runpar = this.parcoll.pforeach { p => array(p._1.in) += 1 } def companion = ForeachSet override def onEnd { diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachHeavy.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachHeavy.scala index f151158ad9..4d7c48b0b4 100644 --- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachHeavy.scala +++ b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachHeavy.scala @@ -38,7 +38,7 @@ extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont]) { def companion = ForeachHeavy override def repetitionsPerRun = 250 - def runpar = pa.foreach(ForeachHeavy.fun) + def runpar = pa.pforeach(ForeachHeavy.fun) def runseq = sequentialForeach(ForeachHeavy.fun, sz) def runjsr = jsrarr.apply(ForeachHeavy.funjsr) def comparisonMap = collection.Map("jsr" -> runjsr _) diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachLight.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachLight.scala index 79901148ac..5ef41d8d5b 100644 --- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachLight.scala +++ b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachLight.scala @@ -19,7 +19,7 @@ class ForeachLight(sz: Int, p: Int, what: String) extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont]) { def companion = ForeachLight - def runpar = pa.foreach(ForeachLight.fun) + def runpar = pa.pforeach(ForeachLight.fun) def runseq = sequentialForeach(ForeachLight.fun, sz) def runjsr = jsrarr.apply(ForeachLight.funjsr) def comparisonMap = collection.Map("jsr" -> runjsr _) -- cgit v1.2.3