-
Notifications
You must be signed in to change notification settings - Fork 10
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
multi threaded snapshot loading #440
Conversation
authorization.read_from_snapshot(snapshot, rows_loaded, snapshot_load_ctx); | ||
resource_limits.read_from_snapshot(snapshot, rows_loaded, snapshot_load_ctx); | ||
|
||
constexpr unsigned max_snapshot_load_threads = 4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is diminishing returns beyond this. Really even 2 or 3 is probably similar performance to 4 with current EOS data set.
libraries/chain/controller.cpp
Outdated
|
||
std::vector<std::promise<void>> thread_promises(snapshot_load_threads); | ||
std::list<std::thread> threads; | ||
//this scoped_exit can go away with jthread; but still marked experimental in libc++18 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I goofed this up before making #400. I thought I tested locally with libc++18 I could use jthread
but clearly that isn't the case.
Note:start |
these stored snapshots are used for future test_compatible_versions runs
Add multi threaded snapshot loading.
Different environments will have different performance uplifts, but in my environment with a recent EOS snapshot, loading time decreased from 90 seconds to 60 seconds.
This implements a very simple parallelization scheme where each snapshot section (which roughly corresponds to each chainbase table) is loaded in parallel. To get better parallelization we will need to load a single chainbase table in parallel since the contract table far outweighs the other tables. That is certainly doable, but far more complex.
Resolves #437