Skip to content

Commit

Permalink
Avoid quadratic performance wrt classpath length
Browse files Browse the repository at this point in the history
  • Loading branch information
retronym committed Dec 12, 2018
1 parent 29c9cbc commit d9a4252
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/compiler/scala/tools/nsc/PipelineMain.scala
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ class PipelineMainClass(label: String, parallelism: Int, strategy: BuildStrategy
println(f" Wall Clock: ${timer.durationMs}%.0f ms")
case Pipeline =>
projects.foreach { p =>
val depsReady = Future.sequence(dependsOn.getOrElse(p, Nil).map(task => p.dependencyReadyFuture(task.t)))
val depsReady = Future.sequence(dependsOn.getOrElse(p, Nil).iterator.map(task => p.dependencyReadyFuture(task.t)))
val f = for {
_ <- depsReady
_ <- {
Expand Down Expand Up @@ -348,10 +348,10 @@ class PipelineMainClass(label: String, parallelism: Int, strategy: BuildStrategy
private def expand(s: command.settings.PathSetting): List[Path] = {
ClassPath.expandPath(s.value, expandStar = true).map(s => Paths.get(s).toAbsolutePath.normalize())
}
def classPath: Seq[Path] = expand(command.settings.classpath)
def macroClassPath: Seq[Path] = expand(command.settings.YmacroClasspath)
def macroClassPathSet: Set[Path] = macroClassPath.toSet
def pluginClassPath: Set[Path] = {
lazy val classPath: Seq[Path] = expand(command.settings.classpath)
lazy val macroClassPath: Seq[Path] = expand(command.settings.YmacroClasspath)
lazy val macroClassPathSet: Set[Path] = macroClassPath.toSet
lazy val pluginClassPath: Set[Path] = {
def asPath(p: String) = ClassPath split p

val paths = command.settings.plugin.value filter (_ != "") flatMap (s => asPath(s) map (s => Paths.get(s)))
Expand Down

0 comments on commit d9a4252

Please sign in to comment.