oxen-core/src/cryptonote_protocol
Jason Rhinelander d4635e5344 Optimizations and simplifications
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
2019-08-11 22:35:00 -03:00
..
block_queue.cpp Optimizations and simplifications 2019-08-11 22:35:00 -03:00
block_queue.h Update monero copyright to 2019 pre-emptively to make merge simpler 2019-04-12 14:36:43 +10:00
CMakeLists.txt Update monero copyright to 2019 pre-emptively to make merge simpler 2019-04-12 14:36:43 +10:00
cryptonote_protocol_defs.h Remove NOTIFY_NEW_DEREGISTER_VOTE code, deprecated by service node vote 2019-08-07 10:18:53 +10:00
cryptonote_protocol_handler-base.cpp Update monero copyright to 2019 pre-emptively to make merge simpler 2019-04-12 14:36:43 +10:00
cryptonote_protocol_handler.h Remove NOTIFY_NEW_DEREGISTER_VOTE code, deprecated by service node vote 2019-08-07 10:18:53 +10:00
cryptonote_protocol_handler.inl Use defer on scope exit to remove some repetitive code (#771) 2019-08-07 11:45:37 +10:00
cryptonote_protocol_handler_common.h Remove NOTIFY_NEW_DEREGISTER_VOTE code, deprecated by service node vote 2019-08-07 10:18:53 +10:00