diff --git a/bench/src/main/scala-2/cats/collections/bench/BitSetBenchmarks.scala b/bench/src/main/scala-2/cats/collections/bench/BitSetBenchmarks.scala index 08e79cb6..d39ffe50 100644 --- a/bench/src/main/scala-2/cats/collections/bench/BitSetBenchmarks.scala +++ b/bench/src/main/scala-2/cats/collections/bench/BitSetBenchmarks.scala @@ -44,13 +44,13 @@ class BitSetBenchmarks { var size: Int = _ var indices: Array[Int] = _ - var values: Array[Int] = _ + var values: Vector[Int] = _ var sci: immutable.BitSet = _ var scm: mutable.BitSet = _ var iset: immutable.Set[Int] = _ var ccbs: _root_.cats.collections.BitSet = _ - var values2: Array[Int] = _ + var values2: Vector[Int] = _ var sci2: immutable.BitSet = _ var scm2: mutable.BitSet = _ var iset2: immutable.Set[Int] = _ @@ -63,8 +63,8 @@ class BitSetBenchmarks { val r = new Random(0x13572468) values = (0 until size).iterator.filter { _ => - r.nextDouble < density - }.toArray + r.nextDouble() < density + }.toVector sci = immutable.BitSet(values: _*) scm = mutable.BitSet(values: _*) @@ -72,8 +72,8 @@ class BitSetBenchmarks { ccbs = _root_.cats.collections.BitSet(values: _*) values2 = (0 until size).iterator.filter { _ => - r.nextDouble < density - }.toArray + r.nextDouble() < density + }.toVector sci2 = immutable.BitSet(values2: _*) scm2 = mutable.BitSet(values2: _*) diff --git a/bench/src/main/scala-2/cats/collections/bench/DietAddBench.scala b/bench/src/main/scala-2/cats/collections/bench/DietAddBench.scala index f175888a..402e5604 100644 --- a/bench/src/main/scala-2/cats/collections/bench/DietAddBench.scala +++ b/bench/src/main/scala-2/cats/collections/bench/DietAddBench.scala @@ -77,16 +77,16 @@ class DietAddBench extends BestCaseRangesList { @Benchmark def scalazDievAdd(): Unit = { - scalazValues.foldLeft(Diev.empty[Int])((d, r) => d + r) + scalazValues.foldLeft(Diev.empty[Int])((d, r) => d + r): Unit } @Benchmark def dogsDietAddRange(): Unit = { - dogRanges.foldLeft(Diet.empty[Int])((d, r) => d + Range(r.start, r.end)) + dogRanges.foldLeft(Diet.empty[Int])((d, r) => d + Range(r.start, r.end)): Unit } @Benchmark def scalazDievAddRange(): Unit = { - scalazRanges.foldLeft(Diev.empty[Int])((d, r) => d + ((r.start, r.end))) + scalazRanges.foldLeft(Diev.empty[Int])((d, r) => d + ((r.start, r.end))): Unit } } diff --git a/bench/src/main/scala-2/cats/collections/bench/DietRandomizeBench.scala b/bench/src/main/scala-2/cats/collections/bench/DietRandomizeBench.scala index 62d78917..57f59f6c 100644 --- a/bench/src/main/scala-2/cats/collections/bench/DietRandomizeBench.scala +++ b/bench/src/main/scala-2/cats/collections/bench/DietRandomizeBench.scala @@ -36,29 +36,25 @@ import scala.util.Random @State(Scope.Benchmark) class DietRandomizeBench extends BigNumberLists { -// import dogs.Predef._ - implicit val scalazEnumInt: Monoid[Int] with Enum[Int] with Show[Int] = scalaz.std.anyVal.intInstance @Benchmark def dogsDietAddRandom(): Unit = { - Random.shuffle(scala).foldLeft(Diet.empty[Int])((d, r) => d + r) + Random.shuffle(scala).foldLeft(Diet.empty[Int])((d, r) => d + r): Unit } @Benchmark def scalazDievAddRandom(): Unit = { - Random.shuffle(scalazlst.toList).foldLeft(Diev.empty[Int])((d, r) => d + r) + Random.shuffle(scalazlst.toList).foldLeft(Diev.empty[Int])((d, r) => d + r): Unit } @Benchmark def dogsDietAddRangeRandom(): Unit = { - Random.shuffle(scala).foldLeft(Diet.empty[Int])((d, r) => d + Range(r, r + 10)) + Random.shuffle(scala).foldLeft(Diet.empty[Int])((d, r) => d + Range(r, r + 10)): Unit } @Benchmark def scalazDievAddRangeRandom(): Unit = { - var diev = Diev.empty[Int] - - Random.shuffle(scalazlst.toList).foldLeft(Diev.empty[Int])((d, r) => d + ((r, r + 10))) + Random.shuffle(scalazlst.toList).foldLeft(Diev.empty[Int])((d, r) => d + ((r, r + 10))): Unit } }