Skip to content

Option to disable websockets? (Websocket protocol import is slow) #252

@benharris-conversica

Description

@benharris-conversica

I was doing some profiling to try to speed up my lambda cold starts when I noticed mangum.protocols.websockets is taking up the majority of the import time for Mangum (0.25s / 0.4s total on my system, see below for details). I'd like to be able to disable this import to speed things up. Is it possible to do something like #197 to make websocket support optional?

Profiling details (using https://github.com/nschloe/tuna to visualize):

python -X importtime -c 'from mangum import Mangum' 2> mangum.log
tuna mangum.log

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions