Skip to content

perf(core): make mempool use a dashmap #2536

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

Closed
wants to merge 6 commits into from
Closed

perf(core): make mempool use a dashmap #2536

wants to merge 6 commits into from

Conversation

edg-l
Copy link
Member

@edg-l edg-l commented Apr 23, 2025

Motivation

While looking at the mempool code to fix another issue i noticed a dashmap seemed like a really good fit here, given it is a specialized concurrent hashmap, so i quickly tried to make the mempool use it. One upside is the removal of Results, perfomance wise it doesn't seem impactful.

Copy link

github-actions bot commented Apr 23, 2025

Lines of code report

Total lines added: 5
Total lines removed: 51
Total lines changed: 56

Detailed view
+-------------------------------------------------------+-------+------+
| File                                                  | Lines | Diff |
+-------------------------------------------------------+-------+------+
| ethrex/crates/blockchain/mempool.rs                   | 524   | -47  |
+-------------------------------------------------------+-------+------+
| ethrex/crates/blockchain/payload.rs                   | 553   | +5   |
+-------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/rlpx/eth/transactions.rs | 306   | -3   |
+-------------------------------------------------------+-------+------+
| ethrex/crates/networking/rpc/engine/fork_choice.rs    | 389   | -1   |
+-------------------------------------------------------+-------+------+

Copy link

github-actions bot commented Apr 23, 2025

Benchmark Block Execution Results Comparison Against Main

Command Mean [s] Min [s] Max [s] Relative
base 182.111 ± 0.920 180.375 183.586 1.00
head 182.530 ± 1.270 180.336 183.678 1.00 ± 0.01

@edg-l edg-l marked this pull request as ready for review April 25, 2025 12:53
@edg-l edg-l requested a review from a team as a code owner April 25, 2025 12:53
Copy link
Contributor

@fedacking fedacking left a comment

Choose a reason for hiding this comment

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

LGTM

@edg-l edg-l closed this Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants