Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Comments

perf: replace RwLock<HashMap/HashSet> with DashMap/DashSet#21692

Merged
mattsse merged 5 commits intomainfrom
dani/replace-rwlock-with-dashmap
Feb 3, 2026
Merged

perf: replace RwLock<HashMap/HashSet> with DashMap/DashSet#21692
mattsse merged 5 commits intomainfrom
dani/replace-rwlock-with-dashmap

Conversation

@DaniPopes
Copy link
Member

@DaniPopes DaniPopes commented Feb 2, 2026

Replace RwLock-wrapped collections with DashMap/DashSet for better concurrent access performance.

Changes

  • net/dns/resolver.rs: RwLock<HashMap>DashMap for MapResolver
  • storage/rpc-provider: RwLock<HashMap>DashMap for code_store cache
  • storage/provider/overlay.rs: Arc<RwLock<HashMap>>Arc<DashMap> for overlay cache

Not Changed

  • chain-state/in_memory.rs: Requires atomic multi-lock acquisition for consistency between blocks and numbers maps, so RwLock is still appropriate here.

Replace RwLock-wrapped collections with DashMap/DashSet for better
concurrent access performance:

- transaction-pool/blobstore/mem.rs: RwLock<HashMap> -> DashMap
- transaction-pool/blobstore/disk.rs: RwLock<HashSet> -> DashSet
- net/dns/resolver.rs: RwLock<HashMap> -> DashMap
- storage/rpc-provider: RwLock<HashMap> -> DashMap
- storage/provider/overlay.rs: Arc<RwLock<HashMap>> -> Arc<DashMap>

Note: chain-state/in_memory.rs was not converted as it requires
atomic multi-lock acquisition for consistency.
@DaniPopes DaniPopes force-pushed the dani/replace-rwlock-with-dashmap branch from a638909 to 0d37e83 Compare February 2, 2026 05:10
@DaniPopes DaniPopes closed this Feb 2, 2026
@github-project-automation github-project-automation bot moved this from Backlog to Done in Reth Tracker Feb 2, 2026
@DaniPopes DaniPopes reopened this Feb 2, 2026
@github-project-automation github-project-automation bot moved this from Done to In Progress in Reth Tracker Feb 2, 2026
@mattsse mattsse added this pull request to the merge queue Feb 2, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 2, 2026
@joshieDo joshieDo enabled auto-merge February 2, 2026 19:02
@joshieDo joshieDo added this pull request to the merge queue Feb 2, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 2, 2026
@joshieDo joshieDo added this pull request to the merge queue Feb 2, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 2, 2026
@mattsse mattsse merged commit 46a9b9a into main Feb 3, 2026
47 checks passed
@mattsse mattsse deleted the dani/replace-rwlock-with-dashmap branch February 3, 2026 12:31
@github-project-automation github-project-automation bot moved this from In Progress to Done in Reth Tracker Feb 3, 2026
DaniPopes added a commit that referenced this pull request Feb 3, 2026
Co-authored-by: Georgios Konstantopoulos <[email protected]>
Co-authored-by: joshieDo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants