Skip to content

Optimize non indexer sync - #1027

Merged
ashchan merged 3 commits into
developfrom
optimize-non-indexer-sync
Oct 28, 2019
Merged

Optimize non indexer sync#1027
ashchan merged 3 commits into
developfrom
optimize-non-indexer-sync

Conversation

@ashchan

@ashchan ashchan commented Oct 28, 2019

Copy link
Copy Markdown
Contributor

Local optimization for batch txs from and to the same address.

For each block, simply add a hash map to cache the output tx used by input.

This speeds up tx insert for our batch txs test (e.g. https://explorer.nervos.org/transaction/0x774a3e608afe267617d28db098dd9e36c93df9de75aedf10d8e5fcb55e38e774) from 2-5 txs/sec to 50~ txs/sec.

Note for a real world block that contains many unrelated transactions this optimization won't help. We still need to figure out how to tweak that. But for end user usage I don't think a wallet would have so many transactions.

@ashchan
ashchan requested a review from classicalliu October 28, 2019 06:16
@ashchan
ashchan merged commit f8b0c7e into develop Oct 28, 2019
@ashchan
ashchan deleted the optimize-non-indexer-sync branch November 4, 2019 01:33
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.

2 participants