aboutsummaryrefslogblamecommitdiff
path: root/tests/run/t6584.scala
blob: 24c236ef3590da78233108256c907140600d1d18 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16















                                                                     
object Test {
  def main(args: Array[String]): Unit = {
    val size = 100 * 1024
    val doubled = (1 to size) ++ (1 to size)

    println("Array: " + Array.tabulate(size)(x => x).distinct.size)
    println("Vector: " + Vector.tabulate(size)(x => x).distinct.size)
    println("List: " + List.tabulate(size)(x => x).distinct.size)
    println("Stream: " + Stream.tabulate(size)(x => x).distinct.size)

    println("Array: " + doubled.toArray.distinct.size)
    println("Vector: " + doubled.toVector.distinct.size)
    println("List: " + doubled.toList.distinct.size)
    println("Stream: " + doubled.toStream.distinct.size)
  }
}