-
Notifications
You must be signed in to change notification settings - Fork 824
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
Saving Deployment State is extremely slow due to unoptimized glob #13301
Comments
+1 |
Hey @ErlendHer 👋 thanks for raising this with the detailed report! I've marked this as a feature-request to improve this behavior, though would you be open to filing a PR for this improvement with the suggested changes? |
I'll see if I can find the time for it. Would this require writing unit test for the suggested feature++? |
Opened a PR @josefaidt |
Any update on this? It would be very beneficial for our team (and I'm sure multiple other teams as well) if we could include the optimization in the next release. Right now, we're pushing using our own fork of the CLI with this fix, but we would rather have the entire team use the official release instead. So if anybody from the Amplify team would be able to take a look that would be great. |
Hey @ErlendHer thank you for taking the time to dig into this and file a PR! Let me bump this with the team 🙂 |
It's been another week now, without any further activity @josefaidt |
|
How did you install the Amplify CLI?
No response
If applicable, what version of Node.js are you using?
No response
Amplify CLI Version
12.5.2
What operating system are you using?
MacOS Sonoma
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
Irrelevant
Describe the bug
During
amplify push
, thesaving deployment state
step of the push is taking more than 7 minutes to complete.After debugging and forking the CLI I've identified the issue and also have an (unfinished) fix that resolves this issue.
The problem is that when uploading the "studio-backend" files there is an unoptimized glob which recursively scans all the files/folders in the "amplify" folder.
If you have a project with a significant amount of node_modules or other dependencies this adds a massive amount of overhead to the glob.
Adding
node_module
to the ignore pattern of the glob in our case reduced the time from 6 minutes and 46 seconds to 1.2 seconds which one could say is fairly significant.This 6.5 minutes saved per deploy (and would be worse in the future once we've added more functions and thus more node_modules)
The below code fixes the problem.
packages/amplify-provider-cloudformation/src/utils/upload-current-cloud-backend.ts
Expected behavior
I expected saving deployment state not to take more than 7 minutes.
Below are some benchmarks for how long the different actions took in the saving deployment state step:
Question of the day: What is the bottleneck?
Reproduction steps
Project Identifier
No response
Log output
Additional information
No response
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: