summaryrefslogtreecommitdiff
path: root/test/files/run/t6584.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-11-01 07:29:42 -0700
committerPaul Phillips <paulp@improving.org>2012-11-01 07:29:42 -0700
commit6f273cb58ba69cc8b30ec9b1b31dc015e0ef1a62 (patch)
treecaebb02fd12a0075f5eacc3acaac754766f10f0d /test/files/run/t6584.scala
parente3f4f199dcf012200ddf04e2871de93477474073 (diff)
parent4e4060f4faee791759417f1a598322e90623464d (diff)
downloadscala-6f273cb58ba69cc8b30ec9b1b31dc015e0ef1a62.tar.gz
scala-6f273cb58ba69cc8b30ec9b1b31dc015e0ef1a62.tar.bz2
scala-6f273cb58ba69cc8b30ec9b1b31dc015e0ef1a62.zip
Merge pull request #1535 from paulp/stream-distinct
Fix SI-6584, Stream#distinct uses too much memory.
Diffstat (limited to 'test/files/run/t6584.scala')
-rw-r--r--test/files/run/t6584.scala16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/files/run/t6584.scala b/test/files/run/t6584.scala
new file mode 100644
index 0000000000..24c236ef35
--- /dev/null
+++ b/test/files/run/t6584.scala
@@ -0,0 +1,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)
+ }
+}