Skip to content
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

Update README claims #398

Open
dralley opened this issue Aug 10, 2023 · 1 comment
Open

Update README claims #398

dralley opened this issue Aug 10, 2023 · 1 comment

Comments

@dralley
Copy link

dralley commented Aug 10, 2023

The README makes a number of performance claims which haven't been updated in 7 years, in the meantime the standard library has seen a number of improvements made to core concurrency primitives. It would be nice to provide a more up-to-date description of why one may or may not want to use parking_lot.

Particularly this section

This library provides implementations of Mutex, RwLock, Condvar and Once that are smaller, faster and more flexible than those in the Rust standard library, as well as a ReentrantMutex type which supports recursive locking. It also exposes a low-level API for creating your own efficient synchronization primitives.

When tested on x86_64 Linux, parking_lot::Mutex was found to be 1.5x faster than std::sync::Mutex when uncontended, and up to 5x faster when contended from multiple threads. The numbers for RwLock vary depending on the number of reader and writer threads, but are almost always faster than the standard library RwLock, and even up to 50x faster in some cases.

As it's not clear whether those claims are still true.

@Amanieu
Copy link
Owner

Amanieu commented Aug 11, 2023

They probably aren't true any more, at least on Linux and Windows where the standard library has a new implementation. If you're willing to re-run the benchmarks, I'll happily accept a PR which rewords the README.

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

2 participants