Closed
Description
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:
_FixCodeProcessor.runFirstPhase
, (theNonNullableFix.prepareUnit
s), 22 seconds_FixCodeProcessor.runLaterPhases
, (theNonNullableFix.processUnit
s), 22 seconds_FixCodeProcessor.runLaterPhases
, (theNonNullableFix.finalizeUnit
s), 23 seconds_FixCodeProcessor.runLaterPhases
, (NonNullableFix.finish
,includingInfoBuilder.explainMigration
), 41 seconds
First "Rerun" in the UI:
_FixCodeProcessor.runFirstPhase
, (theNonNullableFix.prepareUnit
s), 13 seconds_FixCodeProcessor.runLaterPhases
, (theNonNullableFix.processUnit
s), 21 seconds_FixCodeProcessor.runLaterPhases
, (theNonNullableFix.finalizeUnit
s), 28 seconds_FixCodeProcessor.runLaterPhases
, (NonNullableFix.finish
,includingInfoBuilder.explainMigration
), 146 secondsNonNullableFix.rerun
, (MigrationState.refresh
, which also callsInfoBuilder.explainMigration
), 200 seconds
Second "Rerun" in the UI:
_FixCodeProcessor.runFirstPhase
, (theNonNullableFix.prepareUnit
s), 33 seconds_FixCodeProcessor.runLaterPhases
, (theNonNullableFix.processUnit
s), 53 seconds_FixCodeProcessor.runLaterPhases
, (theNonNullableFix.finalizeUnit
s), 42 seconds_FixCodeProcessor.runLaterPhases
, (NonNullableFix.finish
,includingInfoBuilder.explainMigration
), 330 secondsNonNullableFix.rerun
, (MigrationState.refresh
, which also callsInfoBuilder.explainMigration
), 387 seconds
Third "Rerun" in the UI:
_FixCodeProcessor.runFirstPhase
, (theNonNullableFix.prepareUnit
s), 35 seconds_FixCodeProcessor.runLaterPhases
, (theNonNullableFix.processUnit
s), 56 seconds_FixCodeProcessor.runLaterPhases
, (theNonNullableFix.finalizeUnit
s), 41 seconds_FixCodeProcessor.runLaterPhases
, (NonNullableFix.finish
,includingInfoBuilder.explainMigration
), 278 secondsNonNullableFix.rerun
, (MigrationState.refresh
, which also callsInfoBuilder.explainMigration
), 356 seconds