Skip to content

[bug] [Performance Regression] Command execution time increased from 20s to 7min after v2 migration (1500+ projects) #2426

@sybernatus

Description

@sybernatus

Describe the bug

Significant performance regression observed after migrating from moon v1 to moon v2.0.4. In a large monorepo environment containing 1,500+ projects, the overhead of command initialization (the graph building and loading phase) has increased exponentially.

Total execution time for commands like moon ci has shifted from 10-20 seconds in v1 to 2-7 minutes in v2.0.4, even when the cache is warm or no tasks are actually executed.

Steps to reproduce

  1. Use a monorepo with 1,500+ project definitions (moon.yml files).
  2. Run a workspace-wide command: moon ci :<target> or a project-specific command: moon run <project>:<target>.
  3. Observe the significant delay (several minutes) before the task execution output begins.

Expected behavior

Initialization and project/task graph scanning should remain performant (ideally under 120 seconds) even with 1,500+ projects, matching or improving upon the performance levels observed in version 1.
Or a possibility to skip some consuming optional treatment (but I'm not sure they are optional 😅)

Screenshots

Environment

moon 2.0.4
proto 0.55.4

Additional context

Here is a log trace for moon ci :lint for example. I anonymized some data on the project names & remove some logs as they are the same during all the calculation.
moon-short.log

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions