From fb78345ba31312410ec31e7f8b8a01ee34ef120d Mon Sep 17 00:00:00 2001 From: Steven Barclay Date: Thu, 9 Feb 2023 21:35:32 +0800 Subject: [PATCH] Avoid repeated Set build in transactions view load Move the line, Set tradables = tradableRepository.getAll(); to the top level of 'TransactionsView.updateList', instead of needlessly calling 'TradableRepository.getAll' (which builds a new set every invocation) for each wallet transaction being iterated over. This was causing a significant slowdown of the view load. --- .../desktop/main/funds/transactions/TransactionsView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionsView.java b/desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionsView.java index 55f33584a6..2fc2e86876 100644 --- a/desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionsView.java +++ b/desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionsView.java @@ -288,11 +288,11 @@ public class TransactionsView extends ActivatableView { } private void updateList() { + Set tradables = tradableRepository.getAll(); + List transactionsListItems = btcWalletService.getTransactions(false) .stream() .map(transaction -> { - Set tradables = tradableRepository.getAll(); - TransactionAwareTradable maybeTradable = tradables.stream() .map(tradable -> { if (tradable instanceof OpenOffer) {