-
Notifications
You must be signed in to change notification settings - Fork 10
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
Migrate to parking_lot #374
base: main
Are you sure you want to change the base?
Migrate to parking_lot #374
Conversation
I would be interested in migrating to parking lot, but before we do we should get some benchmark numbers against ripple's current implementation. Mostly interested in the code size delta. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be interested in migrating to parking lot, but before we do we should get some benchmark numbers against ripple's current implementation. Mostly interested in the code size delta.
ea41a56
to
6876b96
Compare
6876b96
to
e2b3737
Compare
Migrate from std implementations of Mutex and RwLock to the parking_lot implementations. They are faster and more flexible than the those found in the Rust standard library.
17d82d7
to
550b177
Compare
@pahearn73 @brendanobra I rebased the commit on top of the current commit of the repo. Below is the results of the code size. Both where compiled with Without
With
As far as a comparison is considered, you will have todo that testing as I don't have access to a device. If you did a perf run I would look for a decrease in time for |
|
What
Migrate from std implementations of Mutex and RwLock to the parking_lot implementations. They are faster and more flexible than the those found in the Rust standard library. The
parking_lot
implementation also can not be poisoned, meaning that anyMutex
/RwLock
operations do not return aResult<>
making the call tounwrap()
no longer needed.This change does make
parking_lot
crate a part of theripple_sdk
. It is up to the Ripple team to determine if that is an acceptable change.Why
Mutex
andRwLock
operationsunwrap()
s removed.unwrap()
is called a conditional must be inserted with apanic
for theErr
variant.How
By swapping
std::sync::Mutex
withparking_lot::Mutex
andstd::sync::RwLock
withparking_lot::RwLock
.Test
TBD
Checklist