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

Genproofs slow to close & slow in general #207

Open
adiabat opened this issue Oct 1, 2020 · 1 comment
Open

Genproofs slow to close & slow in general #207

adiabat opened this issue Oct 1, 2020 · 1 comment

Comments

@adiabat
Copy link
Contributor

adiabat commented Oct 1, 2020

When we ctrl-break from genproofs, it can take more than 60 seconds.

saveBridgeNodeData() calls WriteForestToDisk() in some cases, and WriteMiscData() which calls close() - those are the main candidates for taking a lot of time. But it should be able to stop within > 10 sec even on a slow computer.

Also genproofs is just too slow in general ... slower than it feels like it should be. Something to check out.

@adiabat
Copy link
Contributor Author

adiabat commented Oct 1, 2020

utreexo/bridgenode/rev.go

Lines 180 to 195 in 92d6ee4

for i := uint32(0); i < offsetsRead; i++ {
blockBuf := bytes.NewBuffer(blockData[offsets[i]:])
// skip 8 bytes, magic bytes + load size.
blockBuf.Read(skip)
// TODO this is probably expensive. fix
err = blocks[i].Deserialize(blockBuf)
if err != nil {
return
}
revBuf := bytes.NewBuffer(revData[revOffsets[i]:])
err = revs[i].Deserialize(revBuf)
if err != nil {
return
}
}

this may be a bottleneck; this part can be made into it's own goroutine / worker, and there can be multiple workers deserializing after it's pulled from disk

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

No branches or pull requests

1 participant