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

Use Mutex in HeaderMetadataCache #5063

Merged

Conversation

nazar-pc
Copy link
Contributor

Due to LruMap usage it is not actually possible to leverage read feature of RwLock, hence change to Mutex that is faster

Copy link
Contributor

@lexnv lexnv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@bkchr
Copy link
Member

bkchr commented Jul 18, 2024

hence change to Mutex that is faster

Is it really faster? :P We can merge this, but not sure.

@bkchr bkchr added the R0-silent Changes should not be mentioned in any release notes label Jul 18, 2024
@bkchr bkchr enabled auto-merge July 18, 2024 12:52
@bkchr bkchr added this pull request to the merge queue Jul 18, 2024
Merged via the queue into paritytech:master with commit d97fbb1 Jul 18, 2024
161 of 164 checks passed
@nazar-pc nazar-pc deleted the use-mutex-in-header-metadata-cache branch July 18, 2024 16:15
@nazar-pc
Copy link
Contributor Author

A little bit, but yes, Mutex is always strictly faster than RwLock, any implementation

TarekkMA pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this pull request Aug 2, 2024
Due to `LruMap` usage it is not actually possible to leverage read
feature of `RwLock`, hence change to `Mutex` that is faster
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R0-silent Changes should not be mentioned in any release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants