Skip to content

BloopInstall is unreasonably slow for large builds #142

@SheliakLyr

Description

@SheliakLyr

Describe the bug

For large gradle builds (hundreds of modules), bloop install takes a lot of time (at least more than 10 minutes for my case, I gave up after that), which makes it unusable when compared to the alternatives (IDEA import takes ~1 minute).

Quick look at the profiler is enough to locate to core issue. For each project, all other projects are fetched in order to match outputs to inputs between projects. The following code is executed for all projects, which does not scale:

  private def getArchiveSourceSetMap(
      rootProject: Project,
      sourceSets: Set[SourceSet]
  ): Map[File, SourceSet] = {
    val archiveSourceSets = for {
      project <- rootProject.getAllprojects.asScala
      archiveTask <- tasksWithType(project, classOf[AbstractArchiveTask])
      sourcePathObj <- getSourcePaths(archiveTask.getRootSpec())
      sourcePath <- sourceSets.find(_.getOutput == sourcePathObj)
    } yield archiveTask.getArchivePath -> sourcePath
    archiveSourceSets.toMap
  }

Expected behavior

BloopInstall should be reasonable fast for large repositories. At least as good as import to the Intellij IDEA.

Operating system

Linux

Version of Gradle

8.8

Version of gradle-bloop

2.13/1.6.2

Version of Bloop

unreleated

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions