-
Notifications
You must be signed in to change notification settings - Fork 5
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
enha: use parking_lot mutex instead of std::sync #1902
Conversation
PR Reviewer Guide 🔍(Review updated until commit b63a909)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
/benchmark |
Benchmark: Git Info:
Configuration:
RPS Stats: Max: 1265.00, Min: 685.00, Avg: 1110.02, StdDev: 71.68 Plot: View Plot |
/benchmark |
Persistent review updated to latest commit b63a909 |
PR Code Suggestions ✨No code suggestions found for the PR. |
Final benchmark: Git Info:
Configuration:
RPS Stats: Max: 1278.00, Min: 772.00, Avg: 1057.73, StdDev: 78.24 Plot: View Plot |
User description
Parking lot mutexes are faster AND RwLock is fairer. However they don't have a poison detection mechanism. Maybe we should keep the std::sync mutexes in places like the executor or the miner if poisoning is actually concern.
PR Type
Enhancement
Description
std::sync::Mutex
withparking_lot::Mutex
across multiple files for improved performanceMutexExt
trait and its usage, simplifying the codebaseparking_lot::Mutex
methodsMutexResultExt
trait, although its usage was removed in the shown changesChanges walkthrough 📝
executor.rs
Replace std::sync::Mutex with parking_lot::Mutex
src/eth/executor/executor.rs
std::sync::Mutex
withparking_lot::Mutex
MutexExt
traitminer.rs
Switch to parking_lot::Mutex in miner module
src/eth/miner/miner.rs
std::sync::Mutex
withparking_lot::Mutex
MutexExt
andMutexResultExt
traitsrocks_state.rs
Implement parking_lot::Mutex in rocks_state
src/eth/storage/permanent/rocks/rocks_state.rs
std::sync::Mutex
withparking_lot::Mutex
MutexExt
traitext.rs
Remove MutexExt trait and related code
src/ext.rs
MutexExt
trait and its implementationMutexResultExt
trait (unused in the shown changes)globals.rs
Integrate parking_lot::Mutex in globals module
src/globals.rs
std::sync::Mutex
withparking_lot::Mutex
MutexExt
traitPR Type
Enhancement
Description
std::sync::Mutex
andstd::sync::RwLock
withparking_lot::Mutex
andparking_lot::RwLock
across multiple files for improved performance.MutexExt
trait and its usage, simplifying the codebase.parking_lot
methods.parking_lot
locks don't have a poison mechanism.MutexResultExt
trait, although its usage was removed in the shown changes.Changes walkthrough 📝
executor.rs
Replace std::sync::Mutex with parking_lot::Mutex
src/eth/executor/executor.rs
std::sync::Mutex
withparking_lot::Mutex
MutexExt
traitminer.rs
Replace std::sync locks with parking_lot equivalents
src/eth/miner/miner.rs
std::sync::Mutex
andstd::sync::RwLock
withparking_lot
equivalents
MutexExt
andMutexResultExt
traitslocks
rpc_context.rs
Replace std::sync::RwLock with parking_lot::RwLock
src/eth/rpc/rpc_context.rs
std::sync::RwLock
withparking_lot::RwLock
handling for poisoned locks
inmemory.rs
Replace std::sync::RwLock with parking_lot::RwLock
src/eth/storage/permanent/inmemory.rs
std::sync::RwLock
withparking_lot::RwLock
parking_lot
syntaxrocks_state.rs
Replace std::sync::Mutex with parking_lot::Mutex
src/eth/storage/permanent/rocks/rocks_state.rs
std::sync::Mutex
withparking_lot::Mutex
for metrics featureparking_lot
methodsinmemory.rs
Replace std::sync::RwLock with parking_lot::RwLock
src/eth/storage/temporary/inmemory.rs
std::sync::RwLock
withparking_lot::RwLock
parking_lot
syntaxext.rs
Remove MutexExt trait
src/ext.rs
MutexExt
trait and its implementationMutexResultExt
traitglobals.rs
Replace std::sync::Mutex with parking_lot::Mutex
src/globals.rs
std::sync::Mutex
withparking_lot::Mutex
parking_lot
syntaxMutexExt
trait