diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-07-16 13:06:38 +1000 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2015-07-15 22:32:43 -0700 |
commit | a2973dfd954c0c094f956becb05a82bee5f7da01 (patch) | |
tree | 2135ee1616ff3920d00c35046be2037af9aa3a3f /test/benchmarking/TreeSetInsertRandom.scala | |
parent | fa8012d28687986902ce1255a19f9f49affb3bca (diff) | |
download | scala-a2973dfd954c0c094f956becb05a82bee5f7da01.tar.gz scala-a2973dfd954c0c094f956becb05a82bee5f7da01.tar.bz2 scala-a2973dfd954c0c094f956becb05a82bee5f7da01.zip |
Remove further references to forkjoin
Use j.u.c.Forkjoin directly in active and disabled tests
Remove bitrotted benchmarks code
I was going to update these to use `java.util.concurrent.ForkJoin`
directly, instead of our deprecated stubs.
But most of them don't compile anymore (e.g. scala.testing.Benchmark
has been removed, ClassTag imports missing).
While I'm all for benchmarks, we should have large swathes of code
checked in that isn't at compiled and run automatically.
I'm happy to help someone resurrect these in a suitable form.
Diffstat (limited to 'test/benchmarking/TreeSetInsertRandom.scala')
-rw-r--r-- | test/benchmarking/TreeSetInsertRandom.scala | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/test/benchmarking/TreeSetInsertRandom.scala b/test/benchmarking/TreeSetInsertRandom.scala deleted file mode 100644 index 7f182548b7..0000000000 --- a/test/benchmarking/TreeSetInsertRandom.scala +++ /dev/null @@ -1,65 +0,0 @@ - -object TreeSetInsertRandom { - - def main(args: Array[String]): Unit = { - val n = 500000 - new JavaUtilTS(n).main(args) - new MutableTS(n).main(args) - new ImmutableTS(n).main(args) - } -} - -class Dummy(val a: Int) extends math.Ordered[Dummy] { - def compare(other: Dummy) = this.a - other.a - - override def toString = a.toString - } - - -class JavaUtilTS(val length: Int) extends testing.Benchmark { - var data: Array[Dummy] = util.Random.shuffle((0 until length) map { a => new Dummy(a) }) toArray - var t: java.util.TreeSet[Dummy] = null - - def run = { - t = new java.util.TreeSet[Dummy]() - - var i = 0 - while (i < length) { - val elem = data(i) - t add elem - i += 1 - } - } -} - -class MutableTS(val length: Int) extends testing.Benchmark { - var data: Array[Dummy] = util.Random.shuffle((0 until length) map { a => new Dummy(a) }) toArray - var t: collection.mutable.TreeSet[Dummy] = null - - def run = { - t = collection.mutable.TreeSet[Dummy]() - - var i = 0 - while (i < length) { - val elem = data(i) - t += elem - i += 1 - } - } -} - -class ImmutableTS(val length: Int) extends testing.Benchmark { - var data: Array[Dummy] = util.Random.shuffle((0 until length) map { a => new Dummy(a) }) toArray - var t: collection.immutable.TreeSet[Dummy] = null - - def run = { - t = collection.immutable.TreeSet[Dummy]() - - var i = 0 - while (i < length) { - val elem = data(i) - t += elem - i += 1 - } - } -} |