-
Notifications
You must be signed in to change notification settings - Fork 26.1k
[v19 backport] fix(core): reduce total memory usage of various migration schematics #60776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v19 backport] fix(core): reduce total memory usage of various migration schematics #60776
Conversation
…the CLI (angular#60386) Currently when we reuse a Tsurge migration is reused externally, there's some glue code that needs to be executed in a specific order. The code gets copied between the different migrations which is error-prone and means that bugs may have to be fixed several times. These changes move the common steps out into a separate function so that only the migration-specific logic (mostly instantiation and logging) is left in the schematic. PR Close angular#60386
This commit changes Tsurge's operation within angular-devkit (i.e. the CLI) to no longer retain all programs across all migrations. This isn't necessary for so-called "funnel" migrations so not retaining the programs for those migrations is a pure performance win. The "complex" migrations may see increased execution time given that the program is now being recreated for the actual migration phase to run, although reduced memory pressure may help alleviate this overhead. Since this new approach should help prevent Node from running out of memory and failing entirely this is preferred over a potentially increased execution time. Fixes angular#59813
I'm AFK at the moment and don't quite see why this is failing the way it does, but I haven't ran the tests locally assuming the cherry-picks would stick (there were no meaningful conflicts except for one file addition). Will look again tomorrow. |
The breakage was unrelated and fixed by #60753. |
67a547b
to
eb672b9
Compare
…the CLI (#60386) (#60776) Currently when we reuse a Tsurge migration is reused externally, there's some glue code that needs to be executed in a specific order. The code gets copied between the different migrations which is error-prone and means that bugs may have to be fixed several times. These changes move the common steps out into a separate function so that only the migration-specific logic (mostly instantiation and logging) is left in the schematic. PR Close #60386 PR Close #60776
…60776) This commit changes Tsurge's operation within angular-devkit (i.e. the CLI) to no longer retain all programs across all migrations. This isn't necessary for so-called "funnel" migrations so not retaining the programs for those migrations is a pure performance win. The "complex" migrations may see increased execution time given that the program is now being recreated for the actual migration phase to run, although reduced memory pressure may help alleviate this overhead. Since this new approach should help prevent Node from running out of memory and failing entirely this is preferred over a potentially increased execution time. Fixes #59813 PR Close #60776
This PR was merged into the repository by commit 9241615. The changes were merged into the following branches: 19.2.x |
…the CLI (angular#60386) (angular#60776) Currently when we reuse a Tsurge migration is reused externally, there's some glue code that needs to be executed in a specific order. The code gets copied between the different migrations which is error-prone and means that bugs may have to be fixed several times. These changes move the common steps out into a separate function so that only the migration-specific logic (mostly instantiation and logging) is left in the schematic. PR Close angular#60386 PR Close angular#60776
This is cherry-picking #60386 and #60774 to the patch branch for v19.
Closes #59813