Skip to content

Loading DefaultSampler slows down cold start when using in Lambda #311

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

Closed
maxday opened this issue Aug 17, 2021 · 1 comment
Closed

Loading DefaultSampler slows down cold start when using in Lambda #311

maxday opened this issue Aug 17, 2021 · 1 comment

Comments

@maxday
Copy link
Contributor

maxday commented Aug 17, 2021

👋 Hello team!

Both LocalSampler and DefaultSampler are mutually exclusive and cannot be used at the same in core/recorder.py
The fact that they are both imported at the very beginning of the file slows down cold start when using this SDK in a Lambda function.

DefaultSampler is quite slow to load and counts for about 6% of the cold start duration in our use case (see the detailed flame graph attached, purple section)

I will propose a PR to delay import in if/else so DefaultSampler won't be loading while using in Lambda.

notLazyLoaded

@maxday
Copy link
Contributor Author

maxday commented Aug 25, 2021

Closing this one as #312 has been merged :)

@maxday maxday closed this as completed Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant