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

Improve ledger cache initialization with multiple threads #2876

Merged

Conversation

guilhermelawless
Copy link
Contributor

@guilhermelawless guilhermelawless commented Aug 10, 2020

Got a 10x speed-up on my system (Ryzen 3600, NVME SSD) on cold initialization, and a small gain on warm initialization.

Checked consistency against RPC account_count, block_count and some entries from representatives.

A system with 4 physical threads scaled well to 40 threads here, so range of values here is [10, 10*hardware_concurrency(), 40] for simplicity.

More complex approach splitting each table for up to 12 threads
@guilhermelawless guilhermelawless added the performance Performance/resource utilization improvement label Aug 10, 2020
@guilhermelawless guilhermelawless added this to the V22.0 milestone Aug 10, 2020
@guilhermelawless guilhermelawless self-assigned this Aug 10, 2020
@guilhermelawless
Copy link
Contributor Author

Last commit moves these parallel methods to the block store, so we can use them in various CLI commands for example. Only read_transaction is accepted and they are suffixed by _par

nano/secure/blockstore_partial.hpp Outdated Show resolved Hide resolved
nano/secure/blockstore_partial.hpp Outdated Show resolved Hide resolved
Copy link
Contributor

@SergiySW SergiySW left a comment

Choose a reason for hiding this comment

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

Interesting why it's faster while it should be sequential read of accounts list

@guilhermelawless guilhermelawless merged commit e2ec2fb into nanocurrency:develop Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance/resource utilization improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants