Skip to content

Make parking_lot dependency optional #650

Closed
@fschutt

Description

@fschutt

Right now winit depends on parking_lot for Mutex handling - while I realize that parking_lot offers faster Mutex implementations than the standard library, it is also a pretty heavy dependency:

parking_lot v0.6.3
├── lock_api v0.1.3
│   ├── owning_ref v0.3.3
│   │   └── stable_deref_trait v1.1.1
│   └── scopeguard v0.3.3
└── parking_lot_core v0.2.14
    ├── rand v0.4.3
    └── smallvec v0.6.5
        └── unreachable v1.0.0
            └── void v1.0.2

This adds a lot of overhead to the compile time. winit is currently using parking_lot pretty much only for the Mutex, which can be exchanged with the std::sync::Mutex, so a simple feature flag should be possible so that crates depending on winit can turn off the parking_lot mutex and use the standard library mutex - many crates don't need that extra performance and would rather go with better compile times.

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