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

spv: Process header batches in parallel #2311

Merged
merged 1 commit into from
Dec 5, 2023
Merged

Conversation

matheusd
Copy link
Member

@matheusd matheusd commented Dec 4, 2023

This switches the initial SPV header fetching process to process each batch of headers in parallel through its various stages.

The initial header sync process is split into a 3-stage pipeline, where batches of headers progress through. Each stage is run on a separate goroutine, providing some parallelism for the entire process.

The following is a rough comparison of sync times with/without this PR (all on mainnet, reference master):

master
[DBG] SYNC: Initial sync completed in 13m3s
[DBG] SYNC: Initial sync completed in 13m2s
[DBG] SYNC: Initial sync completed in 13m34s

master, spvconnect to a known fast peer
[DBG] SYNC: Initial sync completed in 7m42s
[DBG] SYNC: Initial sync completed in 7m4s
[DBG] SYNC: Initial sync completed in 7m22s

this PR
[DBG] SYNC: Initial sync completed in 9m53s
[DBG] SYNC: Initial sync completed in 8m32s
[DBG] SYNC: Initial sync completed in 8m42s

this PR, spvconnect to a known fast peer
[DBG] SYNC: Initial sync completed in 4m49s
[DBG] SYNC: Initial sync completed in 4m46s
[DBG] SYNC: Initial sync completed in 4m43s

Part of #2289.

spv/sync.go Outdated Show resolved Hide resolved
spv/sync.go Outdated Show resolved Hide resolved
spv/sync.go Show resolved Hide resolved
@matheusd matheusd force-pushed the async-headers branch 2 times, most recently from 8d9b54d to 4aeb5cb Compare December 5, 2023 14:45
This switches the initial SPV header fetching process to process each
batch of headers in parallel through its various stages.
@jrick jrick merged commit ab15d98 into decred:master Dec 5, 2023
2 checks passed
@matheusd matheusd deleted the async-headers branch December 5, 2023 15:40
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.

None yet

2 participants