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

enqueue transactions in parallel from p2p #173

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

andyzhang2023
Copy link
Contributor

@andyzhang2023 andyzhang2023 commented Sep 11, 2024

Description

Enqueuing a transaction into the txpool, it costs about 80us per transaction to call txpool.Add(tx), within which the txpool.addLocked(tx) costs only 15us.
So by calling txpool.Add(tx) in parallel, we can improve the performance of txpool.Add(tx) from 12KTPS to 60KTPS:

  1. before improvement: 1s/80us = 1000000/80 = 12500
  2. after improvement: 1s/15us = 1000000/15 = 66666

It helps a lot when the traffic is heavy and a lot of transactions are accumulated in the broadcasting caches, like "p2p buffers", TCP read buffer and TCP write buffers.

@andyzhang2023 andyzhang2023 changed the base branch from main to develop September 11, 2024 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants