Skip to content
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

Simple lambda takes 5seconds to run on Mock Api, but it's instant on the cloud #5103

Closed
anisg opened this issue Aug 16, 2020 · 3 comments
Closed
Labels
feature-request Request a new feature mock Issues tied to the mock functionality pending-release Code has been merged but pending release

Comments

@anisg
Copy link

anisg commented Aug 16, 2020

Describe the bug
For me, simple lambda takes 3 to 5 seconds to run on Mock Api, but instant on the cloud. Is it normal?

My CPU is not fast but not slow either (i7-8565U).

Amplify CLI Version
4.27.1

To Reproduce

P.S: thanks for the Mock API, it's really great.

@anisg anisg changed the title Simple lambda takes 5seconds to run on Mock Api, but instant on the cloud Simple lambda takes 5seconds to run on Mock Api, but it's instant on the cloud Aug 16, 2020
@edwardfoyle
Copy link
Contributor

@anisg yes unfortunately that sounds pretty normal. The main thing that slows down local execution is the CLI parses all of the CFN resources in order to populate any lambda environment variables that may derive their value from other resources. Marking this as an enhancement.

@edwardfoyle edwardfoyle added enhancement mock Issues tied to the mock functionality labels Aug 18, 2020
@edwardfoyle edwardfoyle added the pending-release Code has been merged but pending release label Feb 12, 2021
@edwardfoyle
Copy link
Contributor

We have made several improvements to mock in the latest version of the CLI including some speed optimizations. You will likely still see slower startup times when mocking vs in the cloud but most of the latency now is a result of inefficient module loading across the CLI and not just a mock issue.

@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2021
@josefaidt josefaidt added feature-request Request a new feature and removed enhancement labels Sep 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request a new feature mock Issues tied to the mock functionality pending-release Code has been merged but pending release
Projects
None yet
Development

No branches or pull requests

3 participants