diff options
author | Paul Phillips <paulp@improving.org> | 2010-01-19 03:15:07 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-01-19 03:15:07 +0000 |
commit | 41e80159b37d8a07922fb90d516b9105f2f185b7 (patch) | |
tree | 98db148b7e9cb61f54d483e0b61430bdbb9b6141 /src/compiler/scala/tools/nsc/Settings.scala | |
parent | 135d4f06b174aa585af64b5253aba647982ac4a2 (diff) | |
download | scala-41e80159b37d8a07922fb90d516b9105f2f185b7.tar.gz scala-41e80159b37d8a07922fb90d516b9105f2f185b7.tar.bz2 scala-41e80159b37d8a07922fb90d516b9105f2f185b7.zip |
Digging into why the repl is so slow, discovere...
Digging into why the repl is so slow, discovered that fsc is once again
never reusing compiler instances (but for a different reason than
#1683.) Small changes break equality and the little troopers are so darn
quiet about it. Steady state, hot fsc repl startup times before this
patch:
0m1.747s 0m1.789s 0m1.842s 0m1.690s
After this patch:
0m1.139s 0m1.148s 0m1.090s 0m1.091s
No review. Could use a test case but I have trouble coaxing partest this
far outside the box.
Diffstat (limited to 'src/compiler/scala/tools/nsc/Settings.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/Settings.scala | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/Settings.scala b/src/compiler/scala/tools/nsc/Settings.scala index 157bc2dc1f..4242d0df47 100644 --- a/src/compiler/scala/tools/nsc/Settings.scala +++ b/src/compiler/scala/tools/nsc/Settings.scala @@ -61,9 +61,9 @@ class Settings(errorFn: String => Unit) extends ScalacSettings { private def guessedScalaExtDirs: Option[String] = guess(List("lib"), _.isDirectory) - override def hashCode() = allSettings.hashCode + override def hashCode() = settingSet.hashCode override def equals(that: Any) = that match { - case s: Settings => this.allSettings == s.allSettings + case s: Settings => this.settingSet == s.settingSet case _ => false } @@ -75,7 +75,7 @@ class Settings(errorFn: String => Unit) extends ScalacSettings { case _ => "" == value } - for (setting <- allSettings ; (dep, value) <- setting.dependency) + for (setting <- settingSet ; (dep, value) <- setting.dependency) if (!setting.isDefault && !hasValue(dep, value)) { errorFn("incomplete option " + setting.name + " (requires " + dep.name + ")") return false @@ -811,7 +811,6 @@ trait ScalacSettings { /** A list of all settings */ protected var allsettings: Set[Setting] = TreeSet[Setting]() def settingSet: Set[Setting] = allsettings - def allSettings: List[Setting] = settingSet.toList /** Disable a setting */ def disable(s: Setting) = allsettings -= s |