diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/benchmarking/TreeSetInsert.scala | 15 | ||||
-rw-r--r-- | test/benchmarking/TreeSetIterator.scala | 15 | ||||
-rw-r--r-- | test/benchmarking/TreeSetRemove.scala | 15 |
3 files changed, 27 insertions, 18 deletions
diff --git a/test/benchmarking/TreeSetInsert.scala b/test/benchmarking/TreeSetInsert.scala index 61b064ae33..9ede8aedc5 100644 --- a/test/benchmarking/TreeSetInsert.scala +++ b/test/benchmarking/TreeSetInsert.scala @@ -3,9 +3,9 @@ object TreeSetInsert { def main(args: Array[String]): Unit = { val n = 500000 - new JavaUtilTS(n).main(args) - new MutableTS(n).main(args) - new ImmutableTS(n).main(args) + JavaUtilTS.main(args) + MutableTS.main(args) + ImmutableTS.main(args) } } @@ -16,7 +16,8 @@ class Dummy(val a: Int) extends math.Ordered[Dummy] { } -class JavaUtilTS(val length: Int) extends testing.Benchmark { +object JavaUtilTS extends testing.Benchmark { + val length = sys.props("length").toInt var data: Array[Dummy] = (0 until length) map { a => new Dummy(a) } toArray var t: java.util.TreeSet[Dummy] = null @@ -32,7 +33,8 @@ class JavaUtilTS(val length: Int) extends testing.Benchmark { } } -class MutableTS(val length: Int) extends testing.Benchmark { +object MutableTS extends testing.Benchmark { + val length = sys.props("length").toInt var data: Array[Dummy] = (0 until length) map { a => new Dummy(a) } toArray var t: collection.mutable.TreeSet[Dummy] = null @@ -48,7 +50,8 @@ class MutableTS(val length: Int) extends testing.Benchmark { } } -class ImmutableTS(val length: Int) extends testing.Benchmark { +object ImmutableTS extends testing.Benchmark { + val length = sys.props("length").toInt var data: Array[Dummy] = (0 until length) map { a => new Dummy(a) } toArray var t: collection.immutable.TreeSet[Dummy] = null diff --git a/test/benchmarking/TreeSetIterator.scala b/test/benchmarking/TreeSetIterator.scala index c3b19aa29f..08c20e8b0c 100644 --- a/test/benchmarking/TreeSetIterator.scala +++ b/test/benchmarking/TreeSetIterator.scala @@ -3,9 +3,9 @@ object TreeSetIterator { def main(args: Array[String]): Unit = { val n = 500000 - new JavaUtilTS(n).main(args) - new MutableTS(n).main(args) - new ImmutableTS(n).main(args) + JavaUtilTS.main(args) + MutableTS.main(args) + ImmutableTS.main(args) } } @@ -16,7 +16,8 @@ class Dummy(val a: Int) extends math.Ordered[Dummy] { } -class JavaUtilTS(val length: Int) extends testing.Benchmark { +object JavaUtilTS extends testing.Benchmark { + val length = sys.props("length").toInt var data: Array[Dummy] = (0 until length) map { a => new Dummy(a) } toArray var t: java.util.TreeSet[Dummy] = null @@ -33,7 +34,8 @@ class JavaUtilTS(val length: Int) extends testing.Benchmark { } } -class MutableTS(val length: Int) extends testing.Benchmark { +object MutableTS extends testing.Benchmark { + val length = sys.props("length").toInt var data: Array[Dummy] = (0 until length) map { a => new Dummy(a) } toArray var t: collection.mutable.TreeSet[Dummy] = null @@ -49,7 +51,8 @@ class MutableTS(val length: Int) extends testing.Benchmark { } } -class ImmutableTS(val length: Int) extends testing.Benchmark { +object ImmutableTS extends testing.Benchmark { + val length = sys.props("length").toInt var data: Array[Dummy] = (0 until length) map { a => new Dummy(a) } toArray var t: collection.immutable.TreeSet[Dummy] = null diff --git a/test/benchmarking/TreeSetRemove.scala b/test/benchmarking/TreeSetRemove.scala index 68c07ce70a..f84066f336 100644 --- a/test/benchmarking/TreeSetRemove.scala +++ b/test/benchmarking/TreeSetRemove.scala @@ -3,9 +3,9 @@ object TreeSetRemove { def main(args: Array[String]): Unit = { val n = 500000 - new JavaUtilTS(n).main(args) - new MutableTS(n).main(args) - new ImmutableTS(n).main(args) + JavaUtilTS.main(args) + MutableTS.main(args) + ImmutableTS.main(args) } } @@ -16,7 +16,8 @@ class Dummy(val a: Int) extends math.Ordered[Dummy] { } -class JavaUtilTS(val length: Int) extends testing.Benchmark { +object JavaUtilTS extends testing.Benchmark { + val length = sys.props("length").toInt var data: Array[Dummy] = (0 until length) map { a => new Dummy(a) } toArray var t: java.util.TreeSet[Dummy] = null @@ -33,7 +34,8 @@ class JavaUtilTS(val length: Int) extends testing.Benchmark { } } -class MutableTS(val length: Int) extends testing.Benchmark { +object MutableTS extends testing.Benchmark { + val length = sys.props("length").toInt var data: Array[Dummy] = (0 until length) map { a => new Dummy(a) } toArray var t: collection.mutable.TreeSet[Dummy] = null @@ -49,7 +51,8 @@ class MutableTS(val length: Int) extends testing.Benchmark { } } -class ImmutableTS(val length: Int) extends testing.Benchmark { +object ImmutableTS extends testing.Benchmark { + val length = sys.props("length").toInt var data: Array[Dummy] = (0 until length) map { a => new Dummy(a) } toArray var t: collection.immutable.TreeSet[Dummy] = null |