mirror of
https://github.com/Qortal/qortal.git
synced 2025-03-17 20:52:31 +00:00
Load sorted list of reward share public keys into memory, so that the indexes can be obtained. This is around 100x faster than querying each index separately (and the savings will increase as more keys are added). For 4150 reward share keys, it was taking around 5000ms to query individually, vs 50ms using this approach. The main trade off is that these 4150 keys require around 130kB of additional memory when minting (and this will increase proportionally with more minters). However, this one query was often accounting for 50% of the entire core's CPU usage, so the additional memory usage seems insignificant by comparison. To gain confidence, I ran both old and new approaches side by side, and confirmed that the indexes matched exactly.