Skip to content

Consider moving from parking_lot back to std locks #4610

Closed
@bjorn3

Description

@bjorn3

What problem does this solve or what need does it fill?

In the past the locks in libstd were wrappers around the OS native locks like provided by pthreads. Depending on the use case the locks of parking_lot are faster. For this reason we currently use parking_lot instead. As part of the work tracked in rust-lang/rust#93740 libstd is currently replacing OS native locks with custom implementations. The linux implementation is slightly slower than parking_lot when there is no contention, but it is faster than both parking_lot and the pthreads implementation of glibc and musl under light to extreme contention on at least two benchmarks (Amanieu/parking_lot#338 (comment) and rust-lang/rust#95035 (comment)).

What solution would you like?

We should benchmark the new locking implementation of libstd for the purposes of bevy and switch to them if they don't regress performance. Even if they don't improve

What alternative(s) have you considered?

Wait until rust-lang/rust#93740 is fully done.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-FeatureA new feature, making something new possibleC-PerformanceA change motivated by improving speed, memory usage or compile timesS-BlockedThis cannot move forward until something else changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions