Skip to content

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

Closed
@maxday

Description

@maxday

👋 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions