Skip to content

Migration tool rerun is slower than first run #44086

Closed
@srawlins

Description

@srawlins

TL;DR We run InfoBuilder.explainMigration twice during a rerun, which I think builds up a huge graph of data. Additionally, it seems like even running explainMigration just the first time during a rerun takes much longer than the first time, like 3x to 8x as long.

As an anecdotal test, I deleted many test files from the analyzer code base, to reduce time, then ran dart migrate. I timed the following:

First run:

  1. _FixCodeProcessor.runFirstPhase, (the NonNullableFix.prepareUnits), 22 seconds
  2. _FixCodeProcessor.runLaterPhases, (the NonNullableFix.processUnits), 22 seconds
  3. _FixCodeProcessor.runLaterPhases, (the NonNullableFix.finalizeUnits), 23 seconds
  4. _FixCodeProcessor.runLaterPhases, (NonNullableFix.finish ,including InfoBuilder.explainMigration), 41 seconds

First "Rerun" in the UI:

  1. _FixCodeProcessor.runFirstPhase, (the NonNullableFix.prepareUnits), 13 seconds
  2. _FixCodeProcessor.runLaterPhases, (the NonNullableFix.processUnits), 21 seconds
  3. _FixCodeProcessor.runLaterPhases, (the NonNullableFix.finalizeUnits), 28 seconds
  4. _FixCodeProcessor.runLaterPhases, (NonNullableFix.finish ,including InfoBuilder.explainMigration), 146 seconds
  5. NonNullableFix.rerun, (MigrationState.refresh, which also calls InfoBuilder.explainMigration), 200 seconds

Second "Rerun" in the UI:

  1. _FixCodeProcessor.runFirstPhase, (the NonNullableFix.prepareUnits), 33 seconds
  2. _FixCodeProcessor.runLaterPhases, (the NonNullableFix.processUnits), 53 seconds
  3. _FixCodeProcessor.runLaterPhases, (the NonNullableFix.finalizeUnits), 42 seconds
  4. _FixCodeProcessor.runLaterPhases, (NonNullableFix.finish ,including InfoBuilder.explainMigration), 330 seconds
  5. NonNullableFix.rerun, (MigrationState.refresh, which also calls InfoBuilder.explainMigration), 387 seconds

Third "Rerun" in the UI:

  1. _FixCodeProcessor.runFirstPhase, (the NonNullableFix.prepareUnits), 35 seconds
  2. _FixCodeProcessor.runLaterPhases, (the NonNullableFix.processUnits), 56 seconds
  3. _FixCodeProcessor.runLaterPhases, (the NonNullableFix.finalizeUnits), 41 seconds
  4. _FixCodeProcessor.runLaterPhases, (NonNullableFix.finish ,including InfoBuilder.explainMigration), 278 seconds
  5. NonNullableFix.rerun, (MigrationState.refresh, which also calls InfoBuilder.explainMigration), 356 seconds

Metadata

Metadata

Assignees

Labels

P1A high priority bug; for example, a single project is unusable or has many test failuresarea-migration (deprecated)Deprecated: this label is no longer actively used (was: issues with the `dart migrate` tool).type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)type-performanceIssue relates to performance or code size

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions