summaryrefslogtreecommitdiff
path: root/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/PartialMapLight.scala
blob: 57f8536b9ec567088b75e869a162a7c20db68cc5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package scala.collection.parallel.benchmarks.parallel_array




object PartialMapLight extends Companion {
  def benchName = "partmap-light";
  def apply(sz: Int, parallelism: Int, what: String) = new PartialMapLight(sz, parallelism, what)
  override def comparisons = List()
  override def defaultSize = 100000
  
  def fun: PartialFunction[Cont, Cont] = {
    case c: Cont if c.in >= 0 => c
  }
}

class PartialMapLight(sz: Int, p: Int, what: String)
extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont]) {
  def companion = PartialMapLight
  
  def runpar = pa.collect(PartialMapLight.fun)
  def runseq = sequentialPartialMap(PartialMapLight.fun, sz)
  def comparisonMap = collection.Map()
}