Add debug perf logging to BondRepository.update()

This is in anticipation of speedups we wish to make, as JProfiler
reveals it to be a hotspot during new block arrivals (which are tricky
to profile, as they occur at random).
This commit is contained in:
Steven Barclay 2024-03-09 21:18:24 +08:00
parent 7d2e050474
commit 0a1df44daf
No known key found for this signature in database
GPG Key ID: 9FED6BF1176D500B

View File

@ -213,6 +213,7 @@ public abstract class BondRepository<B extends Bond<T>, T extends BondedAsset> i
protected abstract Stream<T> getBondedAssetStream();
protected void update() {
long ts = System.currentTimeMillis();
log.debug("update");
getBondedAssetStream().forEach(bondedAsset -> {
String uid = bondedAsset.getUid();
@ -226,6 +227,7 @@ public abstract class BondRepository<B extends Bond<T>, T extends BondedAsset> i
updateBondStateFromUnconfirmedUnlockTxs();
bonds.setAll(bondByUidMap.values());
log.debug("update took {} ms", System.currentTimeMillis() - ts);
}