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

Possible performance degradation under mutex contention #2

Open
voximity opened this issue Mar 28, 2024 · 3 comments
Open

Possible performance degradation under mutex contention #2

voximity opened this issue Mar 28, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@voximity
Copy link

We have been considering the possibility of mutex contention causing performance degradation in snarkOS and snarkVM.

The two ecosystems make use of parking_lot for its Mutexes and RwLocks. It is known that parking_lot suffers from performance degradations when under heavy contention. We could confirm this when running the benchmark on a machine that runs a validator on the Canarynet.

image

Steps to Reproduce

N/A. We are looking into analyzing the prevalence of contention, as well as experimenting with replacing the usage of parking_lot with std::sync::Mutex.

Expected Behavior

N/A.

Your Environment

N/A. We tested the benchmark above in Ubuntu on WSL and Ubuntu on bare metal.

@voximity voximity added the bug Something isn't working label Mar 28, 2024
@ljedrz
Copy link

ljedrz commented Apr 5, 2024

The fact that these days std locks are faster is true indeed; I'm assuming this (performance degradation) hasn't been observed yet? FWIW, no lock contention has popped up in perf profiles I've run before, but perhaps I wasn't testing in extreme enough conditions. Also, I tested std locks against parking_lot ones in a stress test for an unrelated network app in the past, but wasn't able to detect a difference in performance (though perhaps that app had fewer lock-related operations involved).

@zosorock
Copy link

how can we monitor this @ljedrz ?

@ljedrz
Copy link

ljedrz commented Apr 15, 2024

with periodic (but not necessarily long) perf runs; high lock contention should be apparent there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants