summaryrefslogtreecommitdiff
path: root/src/scalap
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-05-08 07:03:28 +0000
committerPaul Phillips <paulp@improving.org>2011-05-08 07:03:28 +0000
commit41ac77599ce022087ec595b6da4874b39472019b (patch)
treef188a9e88bc51481d2a5d8ca42e69c2accbd8aa5 /src/scalap
parentb72a9b1455f8f462192f0a6eb3a7544e7600505a (diff)
downloadscala-41ac77599ce022087ec595b6da4874b39472019b.tar.gz
scala-41ac77599ce022087ec595b6da4874b39472019b.tar.bz2
scala-41ac77599ce022087ec595b6da4874b39472019b.zip
Takes 30+% off the startup time for scala/scala...
Takes 30+% off the startup time for scala/scalac with a variety of optimizations pinpointed by tracing method invocations. Frequent guest stars in the parade of slowness were: using Lists and ListBuffers when any amount of random access is needed, using Strings as if one shouldn't have to supply 80 characters of .substring noise to drop a character here and there, imagining that code can be reused in any way shape or form without a savage slowness burn being unleashed upon you and everything you have ever loved, String.format, methods which return tuples, and any method written with appealing scala features which turns out to be called a few orders of magnitude more often than the author probably supposed. This may be only the tip of the iceberg. No review.
Diffstat (limited to 'src/scalap')
-rw-r--r--src/scalap/scala/tools/scalap/Main.scala13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/scalap/scala/tools/scalap/Main.scala b/src/scalap/scala/tools/scalap/Main.scala
index 9ddb521a10..24f26e2b60 100644
--- a/src/scalap/scala/tools/scalap/Main.scala
+++ b/src/scalap/scala/tools/scalap/Main.scala
@@ -126,13 +126,14 @@ class Main {
/**
* The short name of the package (without prefix)
*/
- def name: String = ""
- def asURLs = Nil
+ def name = ""
+ def asURLs = Nil
def asClasspathString = ""
- val context = DefaultJavaContext
- val classes: List[ClassRep] = Nil
- val packages: List[ClassPath[AbstractFile]] = Nil
- val sourcepaths: List[AbstractFile] = Nil
+
+ val context = DefaultJavaContext
+ val classes = IndexedSeq[ClassRep]()
+ val packages = IndexedSeq[ClassPath[AbstractFile]]()
+ val sourcepaths = IndexedSeq[AbstractFile]()
}
}