diff options
Diffstat (limited to 'third_party/immer/tools/scala')
-rw-r--r-- | third_party/immer/tools/scala/README.md | 6 | ||||
-rw-r--r-- | third_party/immer/tools/scala/build.sbt | 27 | ||||
-rw-r--r-- | third_party/immer/tools/scala/src/test/scala/org/immer/benchmarks.scala | 168 | ||||
-rw-r--r-- | third_party/immer/tools/scala/version.sbt | 1 |
4 files changed, 0 insertions, 202 deletions
diff --git a/third_party/immer/tools/scala/README.md b/third_party/immer/tools/scala/README.md deleted file mode 100644 index ce514e445e99..000000000000 --- a/third_party/immer/tools/scala/README.md +++ /dev/null @@ -1,6 +0,0 @@ - -``` -# sbt -> test -> test-only org.immer.* -- -verbose -``` diff --git a/third_party/immer/tools/scala/build.sbt b/third_party/immer/tools/scala/build.sbt deleted file mode 100644 index f2d0bd2cf03c..000000000000 --- a/third_party/immer/tools/scala/build.sbt +++ /dev/null @@ -1,27 +0,0 @@ -/** This is the simplest possible use of ScalaMeter. - * It allows running ScalaMeter benchmarks as part of the test suite. - * It means, that when the test command is run, ScalaMeter benchmarks are run along - * the tests from other test frameworks, such as ScalaTest or ScalaCheck. - */ -lazy val basic = Project( - "basic", - file("."), - settings = Defaults.coreDefaultSettings ++ Seq( - name := "immer-bechmarks", - organization := "org.immer", - scalaVersion := "2.11.1", - scalacOptions ++= Seq("-deprecation", "-unchecked", "-feature", "-Xlint"), - publishArtifact := false, - libraryDependencies ++= Seq( - "com.storm-enroute" %% "scalameter" % "0.8.2" % "test", - "io.github.nicolasstucki" %% "scala-rrb-vector" % "0.1.1" - ), - resolvers ++= Seq( - "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots", - "Sonatype OSS Releases" at "https://oss.sonatype.org/content/repositories/releases" - ), - testFrameworks += new TestFramework("org.scalameter.ScalaMeterFramework"), - parallelExecution in Test := false, - logBuffered := false - ) -) diff --git a/third_party/immer/tools/scala/src/test/scala/org/immer/benchmarks.scala b/third_party/immer/tools/scala/src/test/scala/org/immer/benchmarks.scala deleted file mode 100644 index 98c40a45cd66..000000000000 --- a/third_party/immer/tools/scala/src/test/scala/org/immer/benchmarks.scala +++ /dev/null @@ -1,168 +0,0 @@ -package org.immer - -import org.scalameter.api._ -import scala.collection.immutable.Vector -import scala.collection.immutable.rrbvector.RRBVector - -class BenchmarkBase extends Bench.ForkedTime { - val runs = 20 - val size = 1000 - val step = 10 - val sizes = Gen.range("size")(size, size, 1) - - //def relaxedV(v : RRBVector[Int], n : Int) : RRBVector[Int] = { - // var r = v - // for (i <- 0 to n) { - // r = (RRBVector.empty[Int] :+ i) ++ r - // } - // r - //} - - var vectors = for { s <- sizes } yield Vector.empty[Int] ++ (0 until s) - var rrbvectors = for { s <- sizes } yield RRBVector.empty[Int] ++ (0 until s) - //var rrbvectorsF = for { s <- sizes } yield relaxedV(RRBVector.empty[Int], s) - var rrbsteps = for { s <- sizes } yield RRBVector.empty[Int] ++ (0 until s / step) -} - -class PushBenchmark extends BenchmarkBase { - performance of "push" in { - measure method "Vector" in { using(sizes) config(exec.benchRuns -> runs) in { s => { - var v = Vector.empty[Int] - for (a <- 0 to s) { - v = v :+ a - } - v - }}} - measure method "RRBVector" in { using(sizes) config(exec.benchRuns -> runs) in { s => { - var v = RRBVector.empty[Int] - for (a <- 0 to s) { - v = v :+ a - } - v - }}} - } -} - -class UpdateBenchmark extends BenchmarkBase { - performance of "update" in { - measure method "Vector" in { using(vectors) config(exec.benchRuns -> runs) in { v0 => { - var v = v0 - for (a <- 0 to v.size - 1) { - v = v.updated(a, a + 1) - } - v - }}} - measure method "RRBVector" in { using(rrbvectors) config(exec.benchRuns -> runs) in { v0 => { - var v = v0 - for (a <- 0 to v.size - 1) { - v = v.updated(a, a + 1) - } - v - }}} - //measure method "RRBVector/relaxed" in { using(rrbvectorsF) config(exec.benchRuns -> runs) in { v0 => { - // var v = v0 - // for (a <- 0 to v.size - 1) { - // v = v.updated(a, a + 1) - // } - // v - //}}} - } - performance of "update/random" in { - measure method "Vector" in { using(vectors) config(exec.benchRuns -> runs) in { v0 => { - var v = v0 - var r = new scala.util.Random - for (a <- 0 to v.size - 1) { - v = v.updated(r.nextInt(v.size), a + 1) - } - v - }}} - measure method "RRBVector" in { using(rrbvectors) config(exec.benchRuns -> runs) in { v0 => { - var v = v0 - var r = new scala.util.Random - for (a <- 0 to v.size - 1) { - v = v.updated(r.nextInt(v.size), a + 1) - } - v - }}} - //measure method "RRBVector/relaxed" in { using(rrbvectorsF) config(exec.benchRuns -> runs) in { v0 => { - // var v = v0 - // var r = new scala.util.Random - // for (a <- 0 to v.size - 1) { - // v = v.updated(r.nextInt(v.size), a + 1) - // } - // v - //}}} - } -} - -object IterBenchmark extends BenchmarkBase { - performance of "access/reduce" in { - measure method "Vector" in { using(vectors) config(exec.benchRuns -> runs) in { v => { - v.reduceLeft(_ + _) - }}} - measure method "RRBVector" in { using(rrbvectors) config(exec.benchRuns -> runs) in { v => { - v.reduceLeft(_ + _) - }}} - //measure method "RRBVector/relaxed" in { using(rrbvectorsF) config(exec.benchRuns -> runs) in { v => { - // v.reduceLeft(_ + _) - //}}} - } - performance of "access/idx" in { - measure method "Vector" in { using(vectors) config(exec.benchRuns -> runs) in { v => { - var r = 0 - for (a <- 0 to v.size - 1) { - r += v(a) - } - r - }}} - measure method "RRBVector" in { using(rrbvectors) config(exec.benchRuns -> runs) in { v => { - var r = 0 - for (a <- 0 to v.size - 1) { - r += v(a) - } - r - }}} - //measure method "RRBVector/relaxed" in { using(rrbvectorsF) config(exec.benchRuns -> runs) in { v => { - // var r = 0 - // for (a <- 0 to v.size - 1) { - // r += v(a) - // } - // r - //}}} - } - performance of "access/iter" in { - measure method "Vector" in { using(vectors) config(exec.benchRuns -> runs) in { v => { - var r = 0 - for (a <- v) { - r += a - } - r - }}} - measure method "RRBVector" in { using(rrbvectors) config(exec.benchRuns -> runs) in { v => { - var r = 0 - for (a <- v) { - r += a - } - r - }}} - //measure method "RRBVector/relaxed" in { using(rrbvectorsF) config(exec.benchRuns -> runs) in { v => { - // var r = 0 - // for (a <- v) { - // r += a - // } - // r - //}}} - } -} - -class ConcatBenchmark extends BenchmarkBase { - performance of "concat" in { - measure method "RRBVector ++" in { using(rrbsteps) config(exec.benchRuns -> runs) in { v => { - var r = RRBVector.empty[Int] - for (_ <- 0 to step) { - r = r ++ v - } - r - }}} - } -} diff --git a/third_party/immer/tools/scala/version.sbt b/third_party/immer/tools/scala/version.sbt deleted file mode 100644 index 3f0ac089016a..000000000000 --- a/third_party/immer/tools/scala/version.sbt +++ /dev/null @@ -1 +0,0 @@ -version in ThisBuild := "0.8.2" |