mirror of
https://github.com/oxen-io/oxen-core.git
synced 2023-12-14 02:22:56 +01:00
d4635e5344
This commit makes various simplifications and optimizations, mainly in the service node list code. All in all, this shaves about 5% of the CPU time used for re-processing the entire service node list. In particular: - changed m_state_history from a std::vector to a std::set that sorts on height. This is responsible for the bulk of the CPU reduction by significant reducing the amount of work required for checkpoint culling, which has to shuffle a lot of `state_t`s around when removing from the midde of a vector. - the above also allows replacing the binary-search `std::lower_bound` complexity with a much simpler `find()`. - since the history is now always sorted, removed the error messages related to sorting that either can't happen (on store) or don't matter (on load). - Added some converting constructors to simplify code (for example, a `state_t` can now be very usefully constructed from an r-value `state_serialized`). - Many construct + moves (and a couple construct + copy) were replaced with in-place constructions. - removed some unused variables |
||
---|---|---|
.. | ||
block_queue.cpp | ||
block_queue.h | ||
CMakeLists.txt | ||
cryptonote_protocol_defs.h | ||
cryptonote_protocol_handler-base.cpp | ||
cryptonote_protocol_handler.h | ||
cryptonote_protocol_handler.inl | ||
cryptonote_protocol_handler_common.h |