bisq/core
Steven Barclay 3a97953152
Fix cubic time bug in BondedRolesRepository.update()
Alleviate a cubic time bug during the update of the bonded roles
repository, reducing it to quadratic running time. On Mainnet, this
gives a roughly ten-fold speedup and should allow better scaling in the
event that many new bonded roles are added.

Replace calls to 'BondedRolesRepository.findBondedAssetByHash' with a
lookup into a lazily initialised map of bonded assets (Roles) by hash
(reset at the start of each call to 'BondRepository.update()' to prevent
stale caching). This avoids rescanning the roles list for every pair of
roles and lockup tx outputs, thus reducing the number of steps (to
highest order) from:

  #roles * #roles * #lockup-tx-outputs

to:

  #roles * #lockup-tx-outputs

(The logs show 2 or 3 calls to 'BondedRepository.update()' every time a
new block arrives, and while this was only taking around a second or so
on Mainnet, it could potentially grow to something problematic with
cubic scaling in the number of bonded roles.)
2024-04-19 23:49:48 +02:00
..
.tx Update translations for v1.9.0 2022-04-28 13:12:59 +02:00
src Fix cubic time bug in BondedRolesRepository.update() 2024-04-19 23:49:48 +02:00
build.gradle core: Switch to 'bisq.javafx' Gradle Plugin 2023-08-04 13:27:55 +02:00
update_translations.sh Add Polish translation 2021-12-01 15:13:57 +01:00