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

[4.0] SHiP: Improve startup when large number of SHiP logs in retain directory #1384

Merged
merged 5 commits into from
Jul 10, 2023

Conversation

heifner
Copy link
Member

@heifner heifner commented Jul 10, 2023

Startup of state_history_plugin was very slow when large number of SHiP logs were in the retain directory. Almost all the performance slowness was due to use of boost::flat_map as it sorts and inserts into a vector on each insert. Changing to use a std::map provides much more reasonable performance on startup. Also included in this PR are additional small performance improvements to the scanning of the log/indexs during startup. For my test case, improved from 76 seconds to 7 seconds.

Resolves #1331

@heifner heifner linked an issue Jul 10, 2023 that may be closed by this pull request
libraries/chain/include/eosio/chain/log_catalog.hpp Outdated Show resolved Hide resolved
libraries/chain/include/eosio/chain/log_catalog.hpp Outdated Show resolved Hide resolved
#include <fc/io/cfile.hpp>
#include <fc/io/datastream.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/iostreams/device/mapped_file.hpp>
Copy link
Member

Choose a reason for hiding this comment

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

Can mapped_file.hpp be removed? I don't see it being used.

@heifner heifner added the OCI Work exclusive to OCI team label Jul 10, 2023
@heifner heifner merged commit cf29b35 into release/4.0 Jul 10, 2023
16 checks passed
@heifner heifner deleted the GH-1331-slow-4.0 branch July 10, 2023 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCI Work exclusive to OCI team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LEAP 4.0.3 - Long startup time after upgrade to 4.0.3.
4 participants