mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 01:41:11 +01:00
b417e36a28
Make TradeStatistics3 implement the previously added ComparableExt interface and make TradeStatisticsManager hold them as a TreeSet instead of a HashSet, to support fast retrieval of statistics in any given date range. (Even though red-black trees are generally slower than hash tables, this should not matter here since the set is only being iterated over and infrequently appended, and does not benefit from O(1) lookups/ additions/removals.) Add a 'TradeStatisticsManager.getNavigableTradeStatisticsSet' accessor, which returns the backing TreeSet of the current ObservableSet field, so that callers can access its NavigableSet interface where needed (as there is no ObservableSortedSet or similar in JavaFX). Use this to optimise 'AveragePriceUtil.getAveragePriceTuple', 'DisputeAgentSelection.getLeastUsedDisputeAgent' and 'MutableOfferDataModel.getSuggestedSecurityDeposit', to obtain a narrow date range of trade statistics without streaming over the entire set. Additionally optimise & simplify the price collation in 'TradeStatisticsManager.onAllServicesInitialised', by exploiting the fact that the statistics are now sorted in order of date (which is the presently defined natural order). |
||
---|---|---|
.. | ||
.tx | ||
src | ||
build.gradle | ||
update_translations.sh |