[bisq-network/bisq-core] PriceFeedService#applyLatestPrice() refactoring (#149)

Manfred Karrer notifications at github.com
Wed Aug 15 18:27:44 UTC 2018


ManfredKarrer commented on this pull request.

Hi @tau3 I looked now into the PR...
In Bisq most is single threaded (UI thread). Only several areas like P2p network, persistence or cryptographic operations are multi threaded. The code for setting the Bisq market price from the statistics is running in the UI thread, so the parallel stream and concurrent collections will not have any effect here (at least I am not aware of any). Could you make a performance test to check the old version vs. the new version? 

> +    public void testApplyLatestBisqMarketPrice() {
+        long initialTime = new Date().getTime();
+
+        List<TradeStatistics2> obsoletes = Lists.newArrayList(
+                mockTradeStatistics("a", new Date(initialTime), 5),
+                mockTradeStatistics("b", new Date(initialTime), 6),
+                mockTradeStatistics("b", new Date(initialTime), 7),
+                mockTradeStatistics("a", new Date(initialTime), 8));
+
+        List<TradeStatistics2> stats = new ArrayList<>(obsoletes);
+        stats.add(mockTradeStatistics("a", new Date(initialTime + 100), 8));
+        stats.add(mockTradeStatistics("b", new Date(initialTime + 200), 9));
+
+        Collections.shuffle(stats);
+
+        PriceFeedService service = new PriceFeedService(mock(HttpClient.class),

Has to be PriceNodeHttpClient instead of HttpClient (was changed in recent PRs)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq-core/pull/149#pullrequestreview-146563039
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20180815/e8c28c98/attachment.html>


More information about the bisq-github mailing list